summaryrefslogtreecommitdiffstats
path: root/usr.bin/passwd
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1995-06-24 18:08:25 +0000
committerwpaul <wpaul@FreeBSD.org>1995-06-24 18:08:25 +0000
commit87254380ba02677b45895472eb8a49f84242fdc1 (patch)
tree477a99f250474c073dd1147a5f38091132f49a29 /usr.bin/passwd
parent81948f780489478cb8f53b0ed85e472e229013ba (diff)
downloadFreeBSD-src-87254380ba02677b45895472eb8a49f84242fdc1.zip
FreeBSD-src-87254380ba02677b45895472eb8a49f84242fdc1.tar.gz
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.
Diffstat (limited to 'usr.bin/passwd')
-rw-r--r--usr.bin/passwd/local_passwd.c8
-rw-r--r--usr.bin/passwd/yp_passwd.c4
2 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c
index 89d485f..7ea907b 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 d4abb23..7dd3756 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;
}
OpenPOWER on IntegriCloud