pw(8) often generates an shorter password than eight letters when I try random password generation option. Fix: The functiton 'pw_password' in /usr/src/usr.sbin/pw/pw_user.c should be fixed. /* --- 903,909 ---- l = (random() % 8 + 8); /* 8 - 16 chars */ pw_getrand(rndbuf, l); for (i = 0; i < l; i++) ! pwbuf[i] = chars[rndbuf[i] % (sizeof(chars)-1)]; pwbuf[i] = '\0'; /*--StWMFHSx4x5VFzRZj7BlPeAXuMTgoD3MMiJfQXDtQkWYzWTS Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" *** /usr/src/usr.sbin/pw/pw_user.c Tue Sep 1 20:02:14 1998 --- /usr/src/usr.sbin/pw/pw_user.c Thu Sep 3 13:25:02 1998 *************** *** 903,909 **** l = (random() % 8 + 8); /* 8 - 16 chars */ pw_getrand(rndbuf, l); for (i = 0; i < l; i++) ! pwbuf[i] = chars[rndbuf[i] % sizeof(chars)]; pwbuf[i] = '\0'; How-To-Repeat: Place 'defaultpasswd = "random"' in /etc/pw.conf and execute 'pw useradd -n name'.
State Changed From-To: open->closed updated in HEAD(1.24) and RELENG_2_2(1.1.1.1.2.11) src/usr.sbin/pw/pw_user.c Sat Jan 2 4:37:46 1999 UTC by billf