summaryrefslogtreecommitdiffstats
path: root/etc/rc.shutdown
diff options
context:
space:
mode:
authorsheldonh <sheldonh@FreeBSD.org>2000-07-24 15:14:47 +0000
committersheldonh <sheldonh@FreeBSD.org>2000-07-24 15:14:47 +0000
commit23d54565a3654653f46d0e3d0aced23162f9daed (patch)
treedbb6adbd72b197bdf2cbd896a9d0968f216981ce /etc/rc.shutdown
parente1fc0d32ca2bae20486cc7e0d720a4a9b2c31ebc (diff)
downloadFreeBSD-src-23d54565a3654653f46d0e3d0aced23162f9daed.zip
FreeBSD-src-23d54565a3654653f46d0e3d0aced23162f9daed.tar.gz
Close a window of readability when creating the entropy seed file,
which must not be world-readable.
Diffstat (limited to 'etc/rc.shutdown')
-rw-r--r--etc/rc.shutdown4
1 files changed, 3 insertions, 1 deletions
diff --git a/etc/rc.shutdown b/etc/rc.shutdown
index b2af119..6c54aec 100644
--- a/etc/rc.shutdown
+++ b/etc/rc.shutdown
@@ -34,10 +34,12 @@ case ${entropy_file} in
*)
echo "Writing entropy file."
rm -f ${entropy_file}
+ oumask=`umask`
+ umask 077
touch ${entropy_file} && \
- chmod 600 ${entropy_file} && \
dd if=/dev/random of=${entropy_file} \
bs=4096 count=1 2> /dev/null
+ umask ${oumask}
;;
esac
OpenPOWER on IntegriCloud