svn commit: samba r24018 - in branches/SAMBA_3_2_0/source/nsswitch: .

metze at samba.org metze at samba.org
Tue Jul 24 09:00:02 GMT 2007


Author: metze
Date: 2007-07-24 09:00:00 +0000 (Tue, 24 Jul 2007)
New Revision: 24018

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

Log:
merge from http://samba.org/~tridge/samba_3_2_ctdb/:
add add_trusted_domain() can return NULL

metze
Modified:
   branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c	2007-07-24 08:59:36 UTC (rev 24017)
+++ branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c	2007-07-24 09:00:00 UTC (rev 24018)
@@ -324,7 +324,9 @@
 			domain = add_trusted_domain(p, alternate_name,
 						    &cache_methods,
 						    &sid);
-			setup_domain_child(domain, &domain->child, NULL);
+			if (domain) {
+				setup_domain_child(domain, &domain->child, NULL);
+			}
 		}
 		p=q;
 		if (p != NULL)
@@ -703,32 +705,38 @@
 	
 		domain = add_trusted_domain( lp_workgroup(), lp_realm(),
 					     &cache_methods, &our_sid);
-		domain->primary = True;
-		setup_domain_child(domain, &domain->child, NULL);
+		if (domain) {
+			domain->primary = True;
+			setup_domain_child(domain, &domain->child, NULL);
 		
-		/* Even in the parent winbindd we'll need to
-		   talk to the DC, so try and see if we can
-		   contact it. Theoretically this isn't neccessary
-		   as the init_dc_connection() in init_child_recv()
-		   will do this, but we can start detecting the DC
-		   early here. */
-		set_domain_online_request(domain);
+			/* Even in the parent winbindd we'll need to
+			   talk to the DC, so try and see if we can
+			   contact it. Theoretically this isn't neccessary
+			   as the init_dc_connection() in init_child_recv()
+			   will do this, but we can start detecting the DC
+			   early here. */
+			set_domain_online_request(domain);
+		}
 	}
 
 	/* Local SAM */
 
 	domain = add_trusted_domain(get_global_sam_name(), NULL,
 				    &passdb_methods, get_global_sam_sid());
-	if ( role != ROLE_DOMAIN_MEMBER ) {
-		domain->primary = True;
+	if (domain) {
+		if ( role != ROLE_DOMAIN_MEMBER ) {
+			domain->primary = True;
+		}
+		setup_domain_child(domain, &domain->child, NULL);
 	}
-	setup_domain_child(domain, &domain->child, NULL);
 
 	/* BUILTIN domain */
 
 	domain = add_trusted_domain("BUILTIN", NULL, &passdb_methods,
 				    &global_sid_Builtin);
-	setup_domain_child(domain, &domain->child, NULL);
+	if (domain) {
+		setup_domain_child(domain, &domain->child, NULL);
+	}
 
 	return True;
 }



More information about the samba-cvs mailing list