1
0
mirror of https://github.com/home-assistant/operating-system.git synced 2026-05-08 17:49:46 +01:00

Set umask on swapfile creation (#2436)

Make sure the swapfile is only readable by the owner.
This commit is contained in:
Stefan Agner
2023-03-28 18:18:58 +02:00
committed by GitHub
parent 1edb5c8c9e
commit 399997e83c
@@ -14,6 +14,7 @@ if [ ! -s "${swapfile}" ] || [ "$(stat "${swapfile}" -c '%s')" -lt $((swapsize *
fi
echo "[INFO] Creating swapfile of size $((swapsize *4))k"
umask 0077
dd if=/dev/zero of="${swapfile}" bs=4k count="${swapsize}"
fi