summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chpass/chpass.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/chpass/chpass.c b/chpass/chpass.c
index ad6b985..2504e68 100644
--- a/chpass/chpass.c
+++ b/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");
}