svn commit: samba r21149 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_24/source/nsswitch

gd at samba.org gd at samba.org
Mon Feb 5 15:04:17 GMT 2007


Author: gd
Date: 2007-02-05 15:04:09 +0000 (Mon, 05 Feb 2007)
New Revision: 21149

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

Log:
Only say we are a groupmember for the optimized (rid 513) membership
lookup when we actually are. Although the Linux nss winbind backend
protects against num_mem != 0 && buf == NULL.

Guenther

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_group.c
   branches/SAMBA_3_0_24/source/nsswitch/winbindd_group.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_group.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_group.c	2007-02-05 14:59:00 UTC (rev 21148)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_group.c	2007-02-05 15:04:09 UTC (rev 21149)
@@ -221,6 +221,7 @@
 	
 	DEBUG(10, ("group SID %s\n", sid_to_string(sid_string, group_sid)));
 
+	/* Initialize with no members */
 	*num_gr_mem = 0;
 
 	/* HACK ALERT!! This whole routine does not cope with group members
@@ -340,11 +341,13 @@
 
 			DEBUG(10,("fill_grent_mem: user %s in 'Domain Users' in domain %s\n",
 				name, domain->name ));
+
+			/* user is the only member */
+			*num_gr_mem = 1;
 		}
 		
 		*gr_mem = buf;
 		*gr_mem_len = buf_len;
-		*num_gr_mem = 1;
 
 		DEBUG(10, ("num_mem = %u, len = %u, mem = %s\n", (unsigned int)*num_gr_mem, 
 		   (unsigned int)buf_len, *num_gr_mem ? buf : "NULL")); 

Modified: branches/SAMBA_3_0_24/source/nsswitch/winbindd_group.c
===================================================================
--- branches/SAMBA_3_0_24/source/nsswitch/winbindd_group.c	2007-02-05 14:59:00 UTC (rev 21148)
+++ branches/SAMBA_3_0_24/source/nsswitch/winbindd_group.c	2007-02-05 15:04:09 UTC (rev 21149)
@@ -80,6 +80,7 @@
 	
 	DEBUG(10, ("group SID %s\n", sid_to_string(sid_string, group_sid)));
 
+	/* Initialize with no members */
 	*num_gr_mem = 0;
 
 	/* HACK ALERT!! This whole routine does not cope with group members
@@ -201,11 +202,13 @@
 
 			DEBUG(10,("fill_grent_mem: user %s in 'Domain Users' in domain %s\n",
 				name, domain->name ));
+
+			/* user is the only member */
+			*num_gr_mem = 1;
 		}
 		
 		*gr_mem = buf;
 		*gr_mem_len = buf_len;
-		*num_gr_mem = 1;
 
 		DEBUG(10, ("num_mem = %u, len = %u, mem = %s\n", (unsigned int)*num_gr_mem, 
 		   (unsigned int)buf_len, *num_gr_mem ? buf : "NULL")); 



More information about the samba-cvs mailing list