From: Baptiste Daroussin Date: Wed, 26 Dec 2012 18:28:17 +0000 (+0000) Subject: In case of the deletion of a user those whole database has to be regenerated, X-Git-Url: https://git.cameronkatri.com/pw-darwin.git/commitdiff_plain/e384eae800c0d663ba8b68103771103d8e78c0f6?ds=sidebyside In case of the deletion of a user those whole database has to be regenerated, otherwise the user planned to be deleted remain in the pwd.db while removed from the plain text password file. --- diff --git a/pw/pwupd.c b/pw/pwupd.c index 0f2df7a..22662db 100644 --- a/pw/pwupd.c +++ b/pw/pwupd.c @@ -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()"); }