diff options
author | wpaul <wpaul@FreeBSD.org> | 1995-12-09 19:10:20 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1995-12-09 19:10:20 +0000 |
commit | 2718bdefe398c9b77208ec75335928471f1166b5 (patch) | |
tree | 81819dad0fa3569ba3ffd7e7d108802f775e00e4 /usr.bin/passwd | |
parent | dbb2efaeb52634d43b6f3be81e367703d05d9bdd (diff) | |
download | FreeBSD-src-2718bdefe398c9b77208ec75335928471f1166b5.zip FreeBSD-src-2718bdefe398c9b77208ec75335928471f1166b5.tar.gz |
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.
Diffstat (limited to 'usr.bin/passwd')
-rw-r--r-- | usr.bin/passwd/yp_passwd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/passwd/yp_passwd.c b/usr.bin/passwd/yp_passwd.c index a481f2d..86811e3 100644 --- a/usr.bin/passwd/yp_passwd.c +++ b/usr.bin/passwd/yp_passwd.c @@ -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); |