summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2013-12-27 22:33:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2013-12-27 22:33:28 +0000
commitee063e7907091678f09b9bc77c05476a58699890 (patch)
tree88361e03de35c9300130de6fbfd3334405259493
parent86a9a31e44c6e2084a430c43717c1955c4c7b2a8 (diff)
nest random_seed() contents into a single redirection
idea from rpe
-rw-r--r--etc/rc19
1 files changed, 8 insertions, 11 deletions
diff --git a/etc/rc b/etc/rc
index 961052b6d55..8a52487d947 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.413 2013/12/27 22:15:40 deraadt Exp $
+# $OpenBSD: rc,v 1.414 2013/12/27 22:33:27 deraadt Exp $
# System startup script run by init on autoboot
# or after single-user.
@@ -101,16 +101,13 @@ wsconsctl_conf()
random_seed()
{
- if [ -f /var/db/host.random ]; then
- dd if=/var/db/host.random of=/dev/random bs=65536 count=1 \
- > /dev/null 2>&1
- chmod 600 /var/db/host.random >/dev/null 2>&1
-
- # reset seed file, so that if a shutdown-less reboot occurs,
- # the next seed is not a repeat
- dd if=/dev/random of=/var/db/host.random bs=65536 count=1 \
- > /dev/null 2>&1
- fi
+ {
+ # push the old seed into the kernel
+ dd if=/var/db/host.random of=/dev/random bs=65536 count=1
+ chmod 600 /var/db/host.random
+ # ... and create a future seed
+ dd if=/dev/random of=/var/db/host.random bs=65536 count=1
+ } > /dev/null 2>&1
}
fill_baddynamic()