]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Properly initialize the random number generator in pw_getpass().
authorJoerg Wunsch <joerg@FreeBSD.org>
Tue, 21 Aug 2001 13:33:20 +0000 (13:33 +0000)
committerJoerg Wunsch <joerg@FreeBSD.org>
Tue, 21 Aug 2001 13:33:20 +0000 (13:33 +0000)
Right now, the automatically generated passwords have been rather
predictable. :-(

MFC after: 1 day

pw/pw_user.c

index 9d00bfa0c354b9f99776fa9e88acf0c97547f50e..c1bfd947f7dc366991bb4f19af65146d5ff8b1f2 100644 (file)
@@ -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 */