diff options
author | 2001-08-21 13:33:20 +0000 | |
---|---|---|
committer | 2001-08-21 13:33:20 +0000 | |
commit | de8b84558a19f34bd4b34c38662d0deb799d6a71 (patch) | |
tree | 31bf840137dab5276bd95c18513cbe086b2baf63 /pw/pw_user.c | |
parent | 81724f617380223f12894ff980344b8d46da4daa (diff) | |
download | pw-darwin-de8b84558a19f34bd4b34c38662d0deb799d6a71.tar.gz pw-darwin-de8b84558a19f34bd4b34c38662d0deb799d6a71.tar.zst pw-darwin-de8b84558a19f34bd4b34c38662d0deb799d6a71.zip |
Properly initialize the random number generator in pw_getpass().
Right now, the automatically generated passwords have been rather
predictable. :-(
MFC after: 1 day
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r-- | pw/pw_user.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index 9d00bfa..c1bfd94 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -1058,6 +1058,7 @@ pw_getrand(u_char *buf, int len) { int i; + srandomdev(); for (i = 0; i < len; i++) { unsigned long val = random(); /* Use all bits in the random value */ |