]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
Before updating the password database, the pw(8) utility first performs a
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 17 Jul 2008 13:47:59 +0000 (13:47 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 17 Jul 2008 13:47:59 +0000 (13:47 +0000)
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

pw/pwupd.c

index 7e0e3cfb0c2a982fbe9000518480ea59ad11d34e..cb8456d9e7c868badb0d5476ae0917f4b1b06910 100644 (file)
@@ -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