Don't create world-readable swapfiles
This commit is contained in:
parent
a2fad89723
commit
d4986b5fd3
|
@ -106,6 +106,7 @@ with utils;
|
||||||
if [ ! -e "${sw.device}" ]; then
|
if [ ! -e "${sw.device}" ]; then
|
||||||
fallocate -l ${toString sw.size}M "${sw.device}" ||
|
fallocate -l ${toString sw.size}M "${sw.device}" ||
|
||||||
dd if=/dev/zero of="${sw.device}" bs=1M count=${toString sw.size}
|
dd if=/dev/zero of="${sw.device}" bs=1M count=${toString sw.size}
|
||||||
|
chmod 0600 ${sw.device}
|
||||||
mkswap ${sw.device}
|
mkswap ${sw.device}
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue