diff options
author | Joerg Wunsch <joerg@FreeBSD.org> | 2001-08-21 13:33:20 +0000 |
---|---|---|
committer | Joerg Wunsch <joerg@FreeBSD.org> | 2001-08-21 13:33:20 +0000 |
commit | 7c534f87ff6f1e00331c83ef766eb1c3c78883c3 (patch) | |
tree | 83c9e1841b439a85e73b934a4abe9a4334eef09b /pw | |
parent | a7ad3937e5ac46dd20036eb87518c32bad76e953 (diff) | |
download | pw-darwin-7c534f87ff6f1e00331c83ef766eb1c3c78883c3.tar.gz pw-darwin-7c534f87ff6f1e00331c83ef766eb1c3c78883c3.tar.zst pw-darwin-7c534f87ff6f1e00331c83ef766eb1c3c78883c3.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')
-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 */ |