summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2001-08-21 13:33:20 +0000
committerjoerg <joerg@FreeBSD.org>2001-08-21 13:33:20 +0000
commit7cdb2456bce7ffc14cd8a9ab3915ba7288f4cbc0 (patch)
tree6ae300fbba05991b65f9c206678c80a775d6c4e8 /usr.sbin
parent3803cbd626a6e9291e1ffc354ab24ebc14034ac6 (diff)
downloadFreeBSD-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')
-rw-r--r--usr.sbin/pw/pw_user.c1
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 */
OpenPOWER on IntegriCloud