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:
parent
d038d0bd66
commit
50789a2f3a
@ -217,7 +217,12 @@ main(int argc, char *argv[])
|
|||||||
pw_fini();
|
pw_fini();
|
||||||
if (pw == NULL)
|
if (pw == NULL)
|
||||||
err(1, "edit()");
|
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");
|
errx(0, "user information unchanged");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user