Properly initialize the random number generator in pw_getpass().

Right now, the automatically generated passwords have been rather
predictable. :-(

MFC after:	1 day
This commit is contained in:
Joerg Wunsch 2001-08-21 13:33:20 +00:00
parent 376958b412
commit 5c6a35107b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82059

View 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 */