summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2008-07-17 13:47:59 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2008-07-17 13:47:59 +0000
commit824830be058b572e24e0e1afd339751d138700d7 (patch)
tree3f6474887d87efe4d412d0a5753140aff46ee2a3
parentdbc6a54f1ef91ef3196b094ca3c3fc3e6f842a35 (diff)
downloadpw-darwin-824830be058b572e24e0e1afd339751d138700d7.tar.gz
pw-darwin-824830be058b572e24e0e1afd339751d138700d7.tar.zst
pw-darwin-824830be058b572e24e0e1afd339751d138700d7.zip
Before updating the password database, the pw(8) utility first performs a
sanity check by invoking "pwd_mkdb -C". However, if this failed it silently returned success. Fix this so it fails the update operation instead. MFC after: 1 week
-rw-r--r--pw/pwupd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pw/pwupd.c b/pw/pwupd.c
index 7e0e3cf..cb8456d 100644
--- a/pw/pwupd.c
+++ b/pw/pwupd.c
@@ -148,7 +148,8 @@ pw_update(struct passwd * pwd, char const * user, int mode)
* Note: -C is only available in FreeBSD 2.2 and above
*/
#ifdef HAVE_PWDB_C
- if (pwdb("-C", (char *)NULL) == 0) { /* Check only */
+ rc = pwdb("-C", (char *)NULL); /* Check only */
+ if (rc == 0) {
#else
{ /* No -C */
#endif