From 1724847d45e2d32bfecda5dfd09e55f5acf3386e Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Sat, 24 Jun 1995 18:08:25 +0000 Subject: [PATCH] Whoops: getnewpasswd() always says "Changing local password for foo". Change things slightly so this message says "local" or "YP" as needed so we can use it for both NIS and local password changes without confusing people. --- usr.bin/passwd/local_passwd.c | 8 +++++--- usr.bin/passwd/yp_passwd.c | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index 89d485fc7eb..7ea907bb26e 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 d4abb230dac..7dd3756b34d 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; }