svn commit: samba r21387 - in branches: SAMBA_3_0/source/nsswitch SAMBA_3_0_25/source/nsswitch

gd at samba.org gd at samba.org
Fri Feb 16 15:13:58 GMT 2007


Author: gd
Date: 2007-02-16 15:13:57 +0000 (Fri, 16 Feb 2007)
New Revision: 21387

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

Log:
Another important fix for non-AD domains:

Avoid assigning 0 as primary group id for users in NSS calls.
Jerry, please check.

Guenther

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_rpc.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_user.c
   branches/SAMBA_3_0_25/source/nsswitch/winbindd_rpc.c
   branches/SAMBA_3_0_25/source/nsswitch/winbindd_user.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_rpc.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_rpc.c	2007-02-16 15:13:51 UTC (rev 21386)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_rpc.c	2007-02-16 15:13:57 UTC (rev 21387)
@@ -416,6 +416,7 @@
 		
 		user_info->homedir = NULL;
 		user_info->shell = NULL;
+		user_info->primary_gid = (gid_t)-1;
 						
 		SAFE_FREE(user);
 				
@@ -454,6 +455,7 @@
 					    &ctr->info.id21->uni_full_name);
 	user_info->homedir = NULL;
 	user_info->shell = NULL;
+	user_info->primary_gid = (gid_t)-1;
 
 	return NT_STATUS_OK;
 }                                   

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_user.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_user.c	2007-02-16 15:13:51 UTC (rev 21386)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_user.c	2007-02-16 15:13:57 UTC (rev 21387)
@@ -286,6 +286,7 @@
 	   call worked or not.   --jerry  */
 
 	if ( s->gid == (gid_t)-1 ) {
+
 		if (!success) {
 			DEBUG(5, ("Could not query user's %s\\%s\n gid",
 				  s->domain->name, s->username));
@@ -296,13 +297,6 @@
 		s->gid = gid;
 	}
 
-	/* allow the nss backend to override the primary group ID.
-	   If the gid has already been set, then keep it */
-
-	if ( s->gid == (gid_t)-1 ) {
-		s->gid = gid;
-	}
-
 	pw = &s->state->response.data.pw;
 	pw->pw_uid = s->uid;
 	pw->pw_gid = s->gid;

Modified: branches/SAMBA_3_0_25/source/nsswitch/winbindd_rpc.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/winbindd_rpc.c	2007-02-16 15:13:51 UTC (rev 21386)
+++ branches/SAMBA_3_0_25/source/nsswitch/winbindd_rpc.c	2007-02-16 15:13:57 UTC (rev 21387)
@@ -416,6 +416,7 @@
 		
 		user_info->homedir = NULL;
 		user_info->shell = NULL;
+		user_info->primary_gid = (gid_t)-1;
 						
 		SAFE_FREE(user);
 				
@@ -454,6 +455,7 @@
 					    &ctr->info.id21->uni_full_name);
 	user_info->homedir = NULL;
 	user_info->shell = NULL;
+	user_info->primary_gid = (gid_t)-1;
 
 	return NT_STATUS_OK;
 }                                   

Modified: branches/SAMBA_3_0_25/source/nsswitch/winbindd_user.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/winbindd_user.c	2007-02-16 15:13:51 UTC (rev 21386)
+++ branches/SAMBA_3_0_25/source/nsswitch/winbindd_user.c	2007-02-16 15:13:57 UTC (rev 21387)
@@ -286,6 +286,7 @@
 	   call worked or not.   --jerry  */
 
 	if ( s->gid == (gid_t)-1 ) {
+
 		if (!success) {
 			DEBUG(5, ("Could not query user's %s\\%s\n gid",
 				  s->domain->name, s->username));
@@ -296,13 +297,6 @@
 		s->gid = gid;
 	}
 
-	/* allow the nss backend to override the primary group ID.
-	   If the gid has already been set, then keep it */
-
-	if ( s->gid == (gid_t)-1 ) {
-		s->gid = gid;
-	}
-
 	pw = &s->state->response.data.pw;
 	pw->pw_uid = s->uid;
 	pw->pw_gid = s->gid;



More information about the samba-cvs mailing list