Browse Source

nest random_seed() contents into a single redirection

idea from rpe
OPENBSD_5_5
deraadt 11 years ago
parent
commit
3722093477
1 changed files with 8 additions and 11 deletions
  1. +8
    -11
      src/etc/rc

+ 8
- 11
src/etc/rc View File

@ -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 # System startup script run by init on autoboot
# or after single-user. # or after single-user.
@ -101,16 +101,13 @@ wsconsctl_conf()
random_seed() 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() fill_baddynamic()


Loading…
Cancel
Save