diff options
author | joerg <joerg@FreeBSD.org> | 2001-08-21 13:33:20 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 2001-08-21 13:33:20 +0000 |
commit | 7cdb2456bce7ffc14cd8a9ab3915ba7288f4cbc0 (patch) | |
tree | 6ae300fbba05991b65f9c206678c80a775d6c4e8 /usr.sbin/pw | |
parent | 3803cbd626a6e9291e1ffc354ab24ebc14034ac6 (diff) | |
download | FreeBSD-src-7cdb2456bce7ffc14cd8a9ab3915ba7288f4cbc0.zip FreeBSD-src-7cdb2456bce7ffc14cd8a9ab3915ba7288f4cbc0.tar.gz |
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 'usr.sbin/pw')
-rw-r--r-- | usr.sbin/pw/pw_user.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 9d00bfa..c1bfd94 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/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 */ |