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

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sat Nov 17 16:19:00 UTC 2007


Author: nekral-guest
Date: 2007-11-17 16:19:00 +0000 (Sat, 17 Nov 2007)
New Revision: 1367

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/newgrp.c
Log:
Do not request a password when a user uses newgrp to switch to her primary
group.  Debian patch 497_newgrp_primary_group.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2007-11-17 16:05:54 UTC (rev 1366)
+++ upstream/trunk/ChangeLog	2007-11-17 16:19:00 UTC (rev 1367)
@@ -1,5 +1,11 @@
 2007-11-17  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/newgrp.c: Do not request a password when a user uses newgrp
+	to switch to her primary group.
+	Debian patch 497_newgrp_primary_group.
+
+2007-11-17  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/login.c: Log an error if the password entry could not be
 	found (respect LOG_UNKFAIL_ENAB to avoid logging a password). This
 	fixes the Debian bug http://bugs.debian.org/451521

Modified: upstream/trunk/src/newgrp.c
===================================================================
--- upstream/trunk/src/newgrp.c	2007-11-17 16:05:54 UTC (rev 1366)
+++ upstream/trunk/src/newgrp.c	2007-11-17 16:19:00 UTC (rev 1367)
@@ -348,12 +348,15 @@
 #endif
 
 	/*
-	 * see if she is a member of this group. If she isn't a member, she
-	 * needs to provide the group password. If there is no group
-	 * password, she will be denied access anyway.
+	 * see if she is a member of this group (i.e. in the list of
+	 * members of the group, or if the group is her primary group).
 	 *
+	 * If she isn't a member, she needs to provide the group password.
+	 * If there is no group password, she will be denied access
+	 * anyway.
+	 *
 	 */
-	if (!is_on_list (grp->gr_mem, name))
+	if (grp->gr_gid != pwd->pw_gid && !is_on_list (grp->gr_mem, name))
 		needspasswd = 1;
 
 	/*




More information about the Pkg-shadow-commits mailing list