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
This commit is contained in:
Dmitry Morozovsky 2006-09-25 15:06:24 +00:00
parent d038d0bd66
commit 50789a2f3a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=162633

View File

@ -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");
}