summaryrefslogtreecommitdiffstats
path: root/pw
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>2001-08-21 13:33:20 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>2001-08-21 13:33:20 +0000
commit7c534f87ff6f1e00331c83ef766eb1c3c78883c3 (patch)
tree83c9e1841b439a85e73b934a4abe9a4334eef09b /pw
parenta7ad3937e5ac46dd20036eb87518c32bad76e953 (diff)
downloadpw-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.c1
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 */