svn commit: samba r23470 - in branches/SAMBA_3_0/source/lib: .

jpeach at samba.org jpeach at samba.org
Wed Jun 13 20:40:52 GMT 2007


Author: jpeach
Date: 2007-06-13 20:40:50 +0000 (Wed, 13 Jun 2007)
New Revision: 23470

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23470

Log:
Fix supplementary group list truncation for *BSD. We need to pass
the correct group list length and only truncate to NGROUPS_MAX if
it is too long.

Modified:
   branches/SAMBA_3_0/source/lib/system.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/system.c
===================================================================
--- branches/SAMBA_3_0/source/lib/system.c	2007-06-13 19:01:41 UTC (rev 23469)
+++ branches/SAMBA_3_0/source/lib/system.c	2007-06-13 20:40:50 UTC (rev 23470)
@@ -1018,10 +1018,16 @@
 		setlen++;
 	}
 
+	if (setlen > max) {
+		DEBUG(10, ("forced to truncate group list from %d to %d\n",
+			setlen, max));
+		setlen = max;
+	}
+
 #if defined(BROKEN_GETGROUPS)
-	ret = sys_broken_setgroups(max, new_gidset ? new_gidset : gidset);
+	ret = sys_broken_setgroups(setlen, new_gidset ? new_gidset : gidset);
 #else
-	ret = setgroups(max, new_gidset ? new_gidset : gidset);
+	ret = setgroups(setlen, new_gidset ? new_gidset : gidset);
 #endif
 
 	if (new_gidset) {



More information about the samba-cvs mailing list