Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Dec 2012 18:28:18 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244711 - head/usr.sbin/pw
Message-ID:  <201212261828.qBQISIp8017585@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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()");
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212261828.qBQISIp8017585>