mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-16 23:57:54 +01:00
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:
parent
dc15257b81
commit
44440ae8b2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12696
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user