mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 15:36:29 +00:00
Set umask on swapfile creation (#2436)
Make sure the swapfile is only readable by the owner.
This commit is contained in:
parent
1edb5c8c9e
commit
399997e83c
@ -14,6 +14,7 @@ if [ ! -s "${swapfile}" ] || [ "$(stat "${swapfile}" -c '%s')" -lt $((swapsize *
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[INFO] Creating swapfile of size $((swapsize *4))k"
|
echo "[INFO] Creating swapfile of size $((swapsize *4))k"
|
||||||
|
umask 0077
|
||||||
dd if=/dev/zero of="${swapfile}" bs=4k count="${swapsize}"
|
dd if=/dev/zero of="${swapfile}" bs=4k count="${swapsize}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user