Small tweak: the 'is exisating password an empty string' check isn't

quite right. (Thic causes you to get prompted for an 'Old Password' when
changing someone's NIS password even if your password isn't set yet.)
Do it like local_passwd.c does.
This commit is contained in:
Bill Paul 1995-12-09 19:10:20 +00:00
parent dc15257b81
commit 44440ae8b2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12696

View File

@ -135,7 +135,7 @@ yp_passwd(char *user)
printf("Changing NIS password for %s on %s.\n", pw->pw_name, master);
/* Get old password */
if(pw->pw_passwd) {
if(pw->pw_passwd[0]) {
char prompt[40];
s = getpass ("Old password: ");
@ -144,7 +144,8 @@ yp_passwd(char *user)
exit (1);
}
yppasswd.oldpass = strdup(s);
}
} else
yppasswd.oldpass = "";
if ((s = getnewpasswd(pw, 1)) == NULL)
exit (1);