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

jra at samba.org jra at samba.org
Wed Dec 20 04:50:47 GMT 2006


Author: jra
Date: 2006-12-20 04:50:46 +0000 (Wed, 20 Dec 2006)
New Revision: 20270

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

Log:
Even with the dual daemon mode the parent winbindd
still needs to contact the DC's for non async requests
like enumerate users/groups etc. Now that online
DC detection is tied to async events we must enable
the processing of events in the main loop of winbindd.
Finally got rid of the last hard coded domain->initialized = 1
code in init_child_recv() - now all domain->initialized = True
gets done only in the connection manager code when either
we're online and have spoken to the DC or are offline and
we know we can't talk to the DC.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
   branches/SAMBA_3_0_24/source/nsswitch/winbindd.c
   branches/SAMBA_3_0_24/source/nsswitch/winbindd_util.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd.c	2006-12-20 01:10:04 UTC (rev 20269)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd.c	2006-12-20 04:50:46 UTC (rev 20270)
@@ -708,7 +708,7 @@
 	struct fd_event *ev;
 	fd_set r_fds, w_fds;
 	int maxfd, listen_sock, listen_priv_sock, selret;
-	struct timeval timeout;
+	struct timeval timeout, ev_timeout;
 
 	/* We'll be doing this a lot */
 
@@ -716,8 +716,10 @@
 
 	message_dispatch();
 
+	run_events();
+
 	/* refresh the trusted domain cache */
-		   
+
 	rescan_trusted_domains();
 
 	/* Free up temporary memory */
@@ -745,6 +747,11 @@
 	timeout.tv_sec = WINBINDD_ESTABLISH_LOOP;
 	timeout.tv_usec = 0;
 
+	/* Check for any event timeouts. */
+	if (get_timed_events_timeout(&ev_timeout)) {
+		timeout = timeval_min(&timeout, &ev_timeout);
+	}
+
 	/* Set up client readers and writers */
 
 	state = winbindd_client_list();

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_util.c	2006-12-20 01:10:04 UTC (rev 20269)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_util.c	2006-12-20 04:50:46 UTC (rev 20270)
@@ -285,6 +285,15 @@
 						    &cache_methods,
 						    &sid);
 			setup_domain_child(domain, &domain->child, NULL);
+			if (!domain->internal) {
+				/* 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);
+			}
 		}
 		p=q;
 		if (p != NULL)
@@ -443,7 +452,7 @@
 	state->domain->sequence_number =
 		state->response->data.domain_info.sequence_number;
 
-	state->domain->initialized = 1;
+	init_dc_connection(state->domain);
 
 	if (state->continuation != NULL)
 		state->continuation(state->private_data, True);
@@ -515,6 +524,13 @@
 					     &cache_methods, &our_sid);
 		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);
 	}
 
 	/* Local SAM */

Modified: branches/SAMBA_3_0_24/source/nsswitch/winbindd.c
===================================================================
--- branches/SAMBA_3_0_24/source/nsswitch/winbindd.c	2006-12-20 01:10:04 UTC (rev 20269)
+++ branches/SAMBA_3_0_24/source/nsswitch/winbindd.c	2006-12-20 04:50:46 UTC (rev 20270)
@@ -703,7 +703,7 @@
 	struct fd_event *ev;
 	fd_set r_fds, w_fds;
 	int maxfd, listen_sock, listen_priv_sock, selret;
-	struct timeval timeout;
+	struct timeval timeout, ev_timeout;
 
 	/* We'll be doing this a lot */
 
@@ -711,8 +711,10 @@
 
 	message_dispatch();
 
+	run_events();
+
 	/* refresh the trusted domain cache */
-		   
+
 	rescan_trusted_domains();
 
 	/* Free up temporary memory */
@@ -740,6 +742,11 @@
 	timeout.tv_sec = WINBINDD_ESTABLISH_LOOP;
 	timeout.tv_usec = 0;
 
+	/* Check for any event timeouts. */
+	if (get_timed_events_timeout(&ev_timeout)) {
+		timeout = timeval_min(&timeout, &ev_timeout);
+	}
+
 	/* Set up client readers and writers */
 
 	state = winbindd_client_list();

Modified: branches/SAMBA_3_0_24/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_0_24/source/nsswitch/winbindd_util.c	2006-12-20 01:10:04 UTC (rev 20269)
+++ branches/SAMBA_3_0_24/source/nsswitch/winbindd_util.c	2006-12-20 04:50:46 UTC (rev 20270)
@@ -285,6 +285,15 @@
 						    &cache_methods,
 						    &sid);
 			setup_domain_child(domain, &domain->child, NULL);
+			if (!domain->internal) {
+				/* 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);
+			}
 		}
 		p=q;
 		if (p != NULL)
@@ -443,7 +452,7 @@
 	state->domain->sequence_number =
 		state->response->data.domain_info.sequence_number;
 
-	state->domain->initialized = 1;
+	init_dc_connection(state->domain);
 
 	if (state->continuation != NULL)
 		state->continuation(state->private_data, True);
@@ -515,6 +524,13 @@
 					     &cache_methods, &our_sid);
 		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);
 	}
 
 	/* Local SAM */



More information about the samba-cvs mailing list