[Pkg-shadow-commits] r1771 - in upstream/trunk: . src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sun Feb 10 20:25:39 UTC 2008


Author: nekral-guest
Date: 2008-02-10 20:25:39 +0000 (Sun, 10 Feb 2008)
New Revision: 1771

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/NEWS
   upstream/trunk/src/usermod.c
Log:
Fix the handling of -a when a user is being renamed (with -l). The new
name of the user was used for the new supplementary groups, but not in the
existing ones.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-02-10 19:14:20 UTC (rev 1770)
+++ upstream/trunk/ChangeLog	2008-02-10 20:25:39 UTC (rev 1771)
@@ -1,5 +1,11 @@
 2008-02-10  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* NEWS, src/usermod.c: Fix the handling of -a when a user is being
+	renamed (with -l). The new name of the user was used for the new
+	supplementary groups, but not in the existing ones.
+
+2008-02-10  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/newusers.c: Set the shadow's password instead of the
 	passwd's password. Fix wrong cut&paste.
 

Modified: upstream/trunk/NEWS
===================================================================
--- upstream/trunk/NEWS	2008-02-10 19:14:20 UTC (rev 1770)
+++ upstream/trunk/NEWS	2008-02-10 20:25:39 UTC (rev 1771)
@@ -65,6 +65,7 @@
     one, no changes will be performed for that field. If no fields are
     changed, usermod will exist successfully with a warning. This avoids
     logging changes to syslog when there are actually no changes.
+  * Fix the handling of -a when a user is being renamed (with -l)
 - vipw/vigr
   * Recommend editing the shadowed (resp. regular) file if the regular (resp.
     shadowed) file was edited.

Modified: upstream/trunk/src/usermod.c
===================================================================
--- upstream/trunk/src/usermod.c	2008-02-10 19:14:20 UTC (rev 1770)
+++ upstream/trunk/src/usermod.c	2008-02-10 20:25:39 UTC (rev 1771)
@@ -533,7 +533,8 @@
 		 * concurrent groups.
 		 */
 		was_member = is_on_list (grp->gr_mem, user_name);
-		is_member = Gflg && is_on_list (user_groups, grp->gr_name);
+		is_member = Gflg && (   (was_member && aflg)
+		                     || is_on_list (user_groups, grp->gr_name));
 
 		if (!was_member && !is_member)
 			continue;
@@ -629,6 +630,8 @@
 		 * concurrent groups.
 		 */
 		is_member = Gflg && is_on_list (user_groups, sgrp->sg_name);
+		is_member = Gflg && (   (was_member && aflg)
+		                     || is_on_list (user_groups, sgrp->sg_name));
 
 		if (!was_member && !was_admin && !is_member)
 			continue;




More information about the Pkg-shadow-commits mailing list