diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index 89d485fc7eb2..7ea907bb26ee 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -73,15 +73,17 @@ to64(s, v, n) } char * -getnewpasswd(pw) +getnewpasswd(pw, nis) struct passwd *pw; + int nis; { int tries; char *p, *t; char buf[_PASSWORD_LEN+1], salt[9]; struct timeval tv; - (void)printf("Changing local password for %s.\n", pw->pw_name); + (void)printf("Changing %s password for %s.\n", pw->pw_name, + nis ? "YP" : "local"); if (uid && pw->pw_passwd[0] && strcmp(crypt(getpass("Old password:"), pw->pw_passwd), @@ -150,7 +152,7 @@ local_passwd(uname) * classes are implemented, go and get the "offset" value for this * class and reset the timer. */ - pw->pw_passwd = getnewpasswd(pw); + pw->pw_passwd = getnewpasswd(pw, 0); pw->pw_change = 0; pw_copy(pfd, tfd, pw); diff --git a/usr.bin/passwd/yp_passwd.c b/usr.bin/passwd/yp_passwd.c index d4abb230dacf..7dd3756b34df 100644 --- a/usr.bin/passwd/yp_passwd.c +++ b/usr.bin/passwd/yp_passwd.c @@ -50,7 +50,7 @@ uid_t uid; static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; -extern char *getnewpasswd __P(( struct passwd * )); +extern char *getnewpasswd __P(( struct passwd * , int )); char * getfield(char *gecos, char *field, int size) @@ -263,7 +263,7 @@ yp_passwd(char *user) } if (use_yp_passwd) { - if ((s = getnewpasswd(pw)) == NULL) + if ((s = getnewpasswd(pw, 1)) == NULL) exit (1); yppasswd.newpw.pw_passwd = s; }