svn commit: r244711 - head/usr.sbin/pw

Baptiste Daroussin bapt at FreeBSD.org
Wed Dec 26 18:28:18 UTC 2012


Author: bapt
Date: Wed Dec 26 18:28:17 2012
New Revision: 244711
URL: http://svnweb.freebsd.org/changeset/base/244711

Log:
  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.

Modified:
  head/usr.sbin/pw/pwupd.c

Modified: head/usr.sbin/pw/pwupd.c
==============================================================================
--- head/usr.sbin/pw/pwupd.c	Wed Dec 26 18:14:45 2012	(r244710)
+++ head/usr.sbin/pw/pwupd.c	Wed Dec 26 18:28:17 2012	(r244711)
@@ -146,7 +146,11 @@ pw_update(struct passwd * pwd, char cons
 			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()");
 		}


More information about the svn-src-head mailing list