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.
This commit is contained in:
Baptiste Daroussin 2012-12-26 18:28:17 +00:00
parent dc0f2b4217
commit 0083d61abc

View 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()");
}