Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc/rc.d Don't delete the random seed before issuing `rndctl...



details:   https://anonhg.NetBSD.org/src/rev/918e976ac2a3
branches:  trunk
changeset: 971690:918e976ac2a3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri May 01 15:52:38 2020 +0000

description:
Don't delete the random seed before issuing `rndctl -S'.

`rndctl -S' can replace the file just fine, and deleting it ahead of
time adds a window during which we can lose the seed altogether if
the system is interrupted by a crash or power outage.

XXX pullup

diffstat:

 etc/rc.d/random_seed |  4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r ec79d01f095e -r 918e976ac2a3 etc/rc.d/random_seed
--- a/etc/rc.d/random_seed      Fri May 01 14:16:15 2020 +0000
+++ b/etc/rc.d/random_seed      Fri May 01 15:52:38 2020 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: random_seed,v 1.8 2020/02/23 08:53:14 riastradh Exp $
+# $NetBSD: random_seed,v 1.9 2020/05/01 15:52:38 riastradh Exp $
 #
 
 # PROVIDE: random_seed
@@ -93,8 +93,6 @@
        oum="$(umask)"
        umask 077
 
-       rm -Pf "${random_file}"
-
        if ! fs_safe "$(dirname "${random_file}")"; then
                umask "${oum}"
                return 1



Home | Main Index | Thread Index | Old Index