]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
In case of the deletion of a user those whole database has to be regenerated,
authorBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 26 Dec 2012 18:28:17 +0000 (18:28 +0000)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Wed, 26 Dec 2012 18:28:17 +0000 (18:28 +0000)
otherwise the user planned to be deleted remain in the pwd.db while removed from
the plain text password file.

pw/pwupd.c

index 0f2df7a77bef9047b94a461e775cdd0dc0459927..22662dbd0b34a33af2ce9897cbab8400587dba8f 100644 (file)
@@ -146,7 +146,11 @@ pw_update(struct passwd * pwd, char const * user)
                        pw_fini();
                        err(1, "pw_copy()");
                }
-               if (pw_mkdb(user) == -1) {
+               /*
+                * in case of deletion of a user, the whole database
+                * needs to be regenerated
+                */
+               if (pw_mkdb(pw != NULL ? user : NULL) == -1) {
                        pw_fini();
                        err(1, "pw_mkdb()");
                }