=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/passwd/Attic/yp_passwd.c,v retrieving revision 1.13 retrieving revision 1.14 diff -c -r1.13 -r1.14 *** src/usr.bin/passwd/Attic/yp_passwd.c 2000/06/30 16:00:20 1.13 --- src/usr.bin/passwd/Attic/yp_passwd.c 2000/08/01 22:27:51 1.14 *************** *** 1,4 **** ! /* $OpenBSD: yp_passwd.c,v 1.13 2000/06/30 16:00:20 millert Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: yp_passwd.c,v 1.14 2000/08/01 22:27:51 provos Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. *************** *** 34,40 **** */ #ifndef lint /*static char sccsid[] = "from: @(#)yp_passwd.c 1.0 2/2/93";*/ ! static char rcsid[] = "$OpenBSD: yp_passwd.c,v 1.13 2000/06/30 16:00:20 millert Exp $"; #endif /* not lint */ #ifdef YP --- 34,40 ---- */ #ifndef lint /*static char sccsid[] = "from: @(#)yp_passwd.c 1.0 2/2/93";*/ ! static char rcsid[] = "$OpenBSD: yp_passwd.c,v 1.14 2000/08/01 22:27:51 provos Exp $"; #endif /* not lint */ #ifdef YP *************** *** 60,65 **** --- 60,69 ---- #define _PASSWORD_LEN PASS_MAX #endif + extern int pwd_gensalt __P(( char *, int, struct passwd *, char)); + extern int pwd_check __P((struct passwd *, char *)); + extern int pwd_gettries __P((struct passwd *)); + static char *getnewpasswd(); static struct passwd *ypgetpwnam(); *************** *** 181,189 **** { static char buf[_PASSWORD_LEN+1]; register char *p, *t; ! int tries; char salt[_PASSWORD_LEN], *crypt(), *getpass(); - int pwd_gensalt __P(( char *, int, struct passwd *, char)); printf("Changing YP password for %s.\n", pw->pw_name); --- 185,192 ---- { static char buf[_PASSWORD_LEN+1]; register char *p, *t; ! int tries, pwd_tries; char salt[_PASSWORD_LEN], *crypt(), *getpass(); printf("Changing YP password for %s.\n", pw->pw_name); *************** *** 201,206 **** --- 204,211 ---- *old_pass = strdup(p); } + pwd_tries = pwd_gettries(pw); + for (buf[0] = '\0', tries = 0;;) { p = getpass("New password:"); if (!*p) { *************** *** 211,226 **** printf("That password collides with a system feature. Choose another.\n"); continue; } ! if (strlen(p) <= 5 && ++tries < 2) { ! printf("Please enter a longer password.\n"); continue; - } - for (t = p; *t && islower(*t); ++t) - ; - if (!*t && ++tries < 2) { - printf("Please don't use an all-lower case password.\nUnusual capitalization, control characters or digits are suggested.\n"); - continue; - } strncpy(buf, p, sizeof buf-1); buf[sizeof buf-1] = '\0'; if (!strcmp(buf, getpass("Retype new password:"))) --- 216,224 ---- printf("That password collides with a system feature. Choose another.\n"); continue; } ! if ((tries++ < pwd_tries || pwd_tries == 0) ! && pwd_check(pw, p) == 0) continue; strncpy(buf, p, sizeof buf-1); buf[sizeof buf-1] = '\0'; if (!strcmp(buf, getpass("Retype new password:")))