summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1999-07-15 14:31:53 +0000
committerNiels Provos <provos@cvs.openbsd.org>1999-07-15 14:31:53 +0000
commit08e6e0c65201e3dd0aca14becdf7d0a788b22a4a (patch)
treefc1f3fc7958c1ea794f30b41fb135962b8d3ff3d /etc
parent893ba3a842c40c7f5d6f9f14837e0d432dd7767f (diff)
move /etc/host.random to /var/db for readonly /, save the entropy state
into /var/db/host.random at shutdown time, so we can make use of it during reboot to seed our random pool. ok millert@ angelos@ niklas@
Diffstat (limited to 'etc')
-rw-r--r--etc/rc14
-rw-r--r--etc/rc.shutdown6
2 files changed, 14 insertions, 6 deletions
diff --git a/etc/rc b/etc/rc
index e944df553e2..a10922c18df 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.99 1999/05/30 23:20:52 millert Exp $
+# $OpenBSD: rc,v 1.100 1999/07/15 14:31:52 provos Exp $
# System startup script run by init on autoboot
# or after single-user.
@@ -77,10 +77,14 @@ rm -f /fastboot # XXX (root now writeable)
echo 'setting tty flags'
ttyflags -a
-# if there's no /etc/host.random, make one through /dev/urandom
-if [ ! -f /etc/host.random ]; then
- dd if=/dev/urandom of=/etc/host.random bs=1024 count=64 >/dev/null 2>&1
- chmod 600 /etc/host.random
+# if there's no /var/db/host.random, make one through /dev/urandom
+if [ ! -f /var/db/host.random ]; then
+ dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 \
+ >/dev/null 2>&1
+ chmod 600 /var/db/host.random
+else
+ dd if=/var/db/host.random of=/dev/urandom bs=1024 count=64 \
+ >/dev/null 2>&1
fi
# set hostname, turn on network
diff --git a/etc/rc.shutdown b/etc/rc.shutdown
index f38ab55e4a8..2df5f496a33 100644
--- a/etc/rc.shutdown
+++ b/etc/rc.shutdown
@@ -1,4 +1,4 @@
-# $OpenBSD: rc.shutdown,v 1.1 1999/07/06 07:55:03 deraadt Exp $
+# $OpenBSD: rc.shutdown,v 1.2 1999/07/15 14:31:52 provos Exp $
#
# If it exists, this script is run at system-shutdown by reboot(8),
# halt(8).
@@ -8,6 +8,10 @@
echo -n /etc/rc.shutdown in progress...
+# save part of our entropy pool for reuse on reboot
+dd if=/dev/urandom of=/var/db/host.random bs=1024 count=64 >/dev/null 2>&1
+chmod 600 /var/db/host.random
+
#
# Your shell code goes here
#