diff options
author | marck <marck@FreeBSD.org> | 2006-09-25 15:06:24 +0000 |
---|---|---|
committer | marck <marck@FreeBSD.org> | 2006-09-25 15:06:24 +0000 |
commit | d5034d7375557e820a10aeb7375432b74192644e (patch) | |
tree | 545ced6df72b6efe4c40f976ad0fb16bdd1ca312 /usr.bin/chpass | |
parent | 46ab66becfc77565db94f643a82e01f63ba1add0 (diff) | |
download | FreeBSD-src-d5034d7375557e820a10aeb7375432b74192644e.zip FreeBSD-src-d5034d7375557e820a10aeb7375432b74192644e.tar.gz |
Fix bug introduced in rev 1.23:
pw_equal does not check crypted password field, so one cannot change
crypted password keeping other fields intact.
Approved by: des
MCF after: 3 days
Diffstat (limited to 'usr.bin/chpass')
-rw-r--r-- | usr.bin/chpass/chpass.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/chpass/chpass.c b/usr.bin/chpass/chpass.c index ad6b985..2504e68 100644 --- a/usr.bin/chpass/chpass.c +++ b/usr.bin/chpass/chpass.c @@ -217,7 +217,12 @@ main(int argc, char *argv[]) pw_fini(); if (pw == NULL) err(1, "edit()"); - if (pw_equal(old_pw, pw)) + /* + * pw_equal does not check for crypted passwords, so we + * should do it explicitly + */ + if (pw_equal(old_pw, pw) && + strcmp(old_pw->pw_passwd, pw->pw_passwd) == 0) errx(0, "user information unchanged"); } |