[SCM] Samba Shared Repository - branch v3-6-test updated

Michael Adam obnox at samba.org
Fri Jan 21 06:49:28 MST 2011


The branch, v3-6-test has been updated
       via  a554efc s3:docs: document "winbind max domain connections"
       via  fb9e657 s3:winbind: Fork multiple children per domain
      from  d35fc97 s3: Fix a deadlock between smbd and ctdbd

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -----------------------------------------------------------------
commit a554efc92e54d3e94fa1656df85209eba11c83d3
Author: Michael Adam <obnox at samba.org>
Date:   Fri Jan 21 13:49:06 2011 +0100

    s3:docs: document "winbind max domain connections"
    
    Autobuild-User: Michael Adam <obnox at samba.org>
    Autobuild-Date: Fri Jan 21 14:33:57 CET 2011 on sn-devel-104

commit fb9e65735526080cb6cb90ae42ea20c474d90268
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Apr 7 17:45:12 2010 +0200

    s3:winbind: Fork multiple children per domain
    
    This makes us scale better with many simultaneous winbind requests,
    some of which might be slow.
    
    This implementation breaks offline logons, as the cached credentials are
    maintained in a child (this needs fixing). So, if the offline logons are
    active, only allow one DC connection.
    
    Probably the offline logon and the scalable file server cases are
    separate enough so that this patch is useful even with the restriction.

-----------------------------------------------------------------------

Summary of changes:
 .../winbind/winbindmaxdomainconnections.xml        |   24 +++++++++
 source3/include/proto.h                            |    1 +
 source3/param/loadparm.c                           |   24 +++++++++
 source3/winbindd/wb_dsgetdcname.c                  |    2 +-
 source3/winbindd/wb_group_members.c                |    2 +-
 source3/winbindd/wb_lookupname.c                   |    6 ++-
 source3/winbindd/wb_lookupsid.c                    |    4 +-
 source3/winbindd/wb_lookupuseraliases.c            |    2 +-
 source3/winbindd/wb_lookupusergroups.c             |    2 +-
 source3/winbindd/wb_next_grent.c                   |    4 +-
 source3/winbindd/wb_query_user_list.c              |    2 +-
 source3/winbindd/wb_queryuser.c                    |    2 +-
 source3/winbindd/wb_seqnum.c                       |    2 +-
 source3/winbindd/winbindd.h                        |    2 +-
 source3/winbindd/winbindd_change_machine_acct.c    |    2 +-
 source3/winbindd/winbindd_check_machine_acct.c     |    2 +-
 source3/winbindd/winbindd_domain.c                 |   10 +++-
 source3/winbindd/winbindd_dual.c                   |   50 ++++++++++++++++++--
 source3/winbindd/winbindd_list_groups.c            |    2 +-
 source3/winbindd/winbindd_list_users.c             |    2 +-
 source3/winbindd/winbindd_lookuprids.c             |    2 +-
 source3/winbindd/winbindd_ndr.c                    |    5 ++-
 source3/winbindd/winbindd_ping_dc.c                |    2 +-
 source3/winbindd/winbindd_proto.h                  |    3 +
 source3/winbindd/winbindd_util.c                   |   10 ++++
 25 files changed, 141 insertions(+), 28 deletions(-)
 create mode 100644 docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml b/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml
new file mode 100644
index 0000000..3e48356
--- /dev/null
+++ b/docs-xml/smbdotconf/winbind/winbindmaxdomainconnections.xml
@@ -0,0 +1,24 @@
+<samba:parameter name="winbind max domain connections"
+		 context="G"
+		 type="integer"
+		 advanced="1" developer="1"
+		 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+	<para>This parameter specifies the maximum number of simultaneous
+	connections that the <citerefentry><refentrytitle>winbindd</refentrytitle>
+	<manvolnum>8</manvolnum></citerefentry> daemon should open to the
+	domain controller of one domain.
+	Setting this parameter to a value greater than 1 can improve
+	scalability with many simultaneous winbind requests,
+	some of which might be slow.
+	</para>
+	<para>
+	Note that if <smbconfoption name="winbind offline logon"/> is set to
+	<constant>Yes</constant>, then only one
+	DC connection is allowed per domain, regardless of this setting.
+	</para>
+</description>
+
+<value type="default">1</value>
+<value type="example">10</value>
+</samba:parameter>
diff --git a/source3/include/proto.h b/source3/include/proto.h
index f3ec4d1..de6e7ac 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -3230,6 +3230,7 @@ bool lp_winbind_offline_logon(void);
 bool lp_winbind_normalize_names(void);
 bool lp_winbind_rpc_only(void);
 bool lp_create_krb5_conf(void);
+int lp_winbind_max_domain_connections(void);
 const char *lp_idmap_backend(void);
 bool lp_idmap_read_only(void);
 int lp_idmap_cache_time(void);
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 875cab1..b45e045 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -216,6 +216,7 @@ struct global {
 	bool bWinbindNormalizeNames;
 	bool bWinbindRpcOnly;
 	bool bCreateKrb5Conf;
+	int winbindMaxDomainConnections;
 	char *szIdmapBackend;
 	bool bIdmapReadOnly;
 	char *szAddShareCommand;
@@ -4773,6 +4774,15 @@ static struct parm_struct parm_table[] = {
 		.enum_list	= NULL,
 		.flags		= FLAG_ADVANCED,
 	},
+	{
+		.label		= "winbind max domain connections",
+		.type		= P_INTEGER,
+		.p_class	= P_GLOBAL,
+		.ptr		= &Globals.winbindMaxDomainConnections,
+		.special	= NULL,
+		.enum_list	= NULL,
+		.flags		= FLAG_ADVANCED,
+	},
 
 	{NULL,  P_BOOL,  P_NONE,  NULL,  NULL,  NULL,  0}
 };
@@ -5279,6 +5289,7 @@ static void init_globals(bool reinit_globals)
 	Globals.bResetOnZeroVC = False;
 	Globals.bLogWriteableFilesOnExit = False;
 	Globals.bCreateKrb5Conf = true;
+	Globals.winbindMaxDomainConnections = 1;
 
 	/* hostname lookups can be very expensive and are broken on
 	   a large number of sites (tridge) */
@@ -5651,6 +5662,19 @@ FN_GLOBAL_BOOL(lp_winbind_offline_logon, &Globals.bWinbindOfflineLogon)
 FN_GLOBAL_BOOL(lp_winbind_normalize_names, &Globals.bWinbindNormalizeNames)
 FN_GLOBAL_BOOL(lp_winbind_rpc_only, &Globals.bWinbindRpcOnly)
 FN_GLOBAL_BOOL(lp_create_krb5_conf, &Globals.bCreateKrb5Conf)
+static FN_GLOBAL_INTEGER(lp_winbind_max_domain_connections_int,
+		  &Globals.winbindMaxDomainConnections)
+
+int lp_winbind_max_domain_connections(void)
+{
+	if (lp_winbind_offline_logon() &&
+	    lp_winbind_max_domain_connections_int() > 1) {
+		DEBUG(1, ("offline logons active, restricting max domain "
+			  "connections to 1\n"));
+		return 1;
+	}
+	return MAX(1, lp_winbind_max_domain_connections_int());
+}
 
 FN_GLOBAL_CONST_STRING(lp_idmap_backend, &Globals.szIdmapBackend)
 FN_GLOBAL_BOOL(lp_idmap_read_only, &Globals.bIdmapReadOnly)
diff --git a/source3/winbindd/wb_dsgetdcname.c b/source3/winbindd/wb_dsgetdcname.c
index fdd9a6d..207d1b6 100644
--- a/source3/winbindd/wb_dsgetdcname.c
+++ b/source3/winbindd/wb_dsgetdcname.c
@@ -64,7 +64,7 @@ struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx,
 		child = locator_child();
 	} else {
 		struct winbindd_domain *domain = find_our_domain();
-		child = &domain->child;
+		child = choose_domain_child(domain);
 	}
 
 	if (domain_guid != NULL) {
diff --git a/source3/winbindd/wb_group_members.c b/source3/winbindd/wb_group_members.c
index 024b317..c9603e7 100644
--- a/source3/winbindd/wb_group_members.c
+++ b/source3/winbindd/wb_group_members.c
@@ -73,7 +73,7 @@ static struct tevent_req *wb_lookupgroupmem_send(TALLOC_CTX *mem_ctx,
 	}
 
 	subreq = dcerpc_wbint_LookupGroupMembers_send(
-		state, ev, domain->child.binding_handle, &state->sid, type,
+		state, ev, dom_child_handle(domain), &state->sid, type,
 		&state->members);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
diff --git a/source3/winbindd/wb_lookupname.c b/source3/winbindd/wb_lookupname.c
index 4429149..a9b4dfa 100644
--- a/source3/winbindd/wb_lookupname.c
+++ b/source3/winbindd/wb_lookupname.c
@@ -70,7 +70,8 @@ struct tevent_req *wb_lookupname_send(TALLOC_CTX *mem_ctx,
 	}
 
 	subreq = dcerpc_wbint_LookupName_send(
-		state, ev, domain->child.binding_handle, state->dom_name, state->name,
+		state, ev, dom_child_handle(domain),
+		state->dom_name, state->name,
 		flags, &state->type, &state->sid);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
@@ -111,7 +112,8 @@ static void wb_lookupname_done(struct tevent_req *subreq)
 	}
 
 	subreq = dcerpc_wbint_LookupName_send(
-		state, state->ev, root_domain->child.binding_handle, state->dom_name,
+		state, state->ev, dom_child_handle(root_domain),
+		state->dom_name,
 		state->name, state->flags, &state->type, &state->sid);
 	if (tevent_req_nomem(subreq, req)) {
 		return;
diff --git a/source3/winbindd/wb_lookupsid.c b/source3/winbindd/wb_lookupsid.c
index 52e8bcb..2e1b21a 100644
--- a/source3/winbindd/wb_lookupsid.c
+++ b/source3/winbindd/wb_lookupsid.c
@@ -56,7 +56,7 @@ struct tevent_req *wb_lookupsid_send(TALLOC_CTX *mem_ctx,
 	}
 
 	subreq = dcerpc_wbint_LookupSid_send(
-		state, ev, state->lookup_domain->child.binding_handle,
+		state, ev, dom_child_handle(state->lookup_domain),
 		&state->sid, &state->type, &state->domname, &state->name);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
@@ -96,7 +96,7 @@ static void wb_lookupsid_done(struct tevent_req *subreq)
 	state->lookup_domain = forest_root;
 
 	subreq = dcerpc_wbint_LookupSid_send(
-		state, state->ev, state->lookup_domain->child.binding_handle,
+		state, state->ev, dom_child_handle(state->lookup_domain),
 		&state->sid, &state->type, &state->domname, &state->name);
 	if (tevent_req_nomem(subreq, req)) {
 		return;
diff --git a/source3/winbindd/wb_lookupuseraliases.c b/source3/winbindd/wb_lookupuseraliases.c
index 1e9b4c3..f6fe855 100644
--- a/source3/winbindd/wb_lookupuseraliases.c
+++ b/source3/winbindd/wb_lookupuseraliases.c
@@ -47,7 +47,7 @@ struct tevent_req *wb_lookupuseraliases_send(TALLOC_CTX *mem_ctx,
 	state->sids.sids = CONST_DISCARD(struct dom_sid *, sids);
 
 	subreq = dcerpc_wbint_LookupUserAliases_send(
-		state, ev, domain->child.binding_handle, &state->sids, &state->rids);
+		state, ev, dom_child_handle(domain), &state->sids, &state->rids);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
diff --git a/source3/winbindd/wb_lookupusergroups.c b/source3/winbindd/wb_lookupusergroups.c
index 27a6a5b..aeffc17 100644
--- a/source3/winbindd/wb_lookupusergroups.c
+++ b/source3/winbindd/wb_lookupusergroups.c
@@ -46,7 +46,7 @@ struct tevent_req *wb_lookupusergroups_send(TALLOC_CTX *mem_ctx,
 	sid_copy(&state->sid, sid);
 
 	subreq = dcerpc_wbint_LookupUserGroups_send(
-		state, ev, domain->child.binding_handle, &state->sid, &state->sids);
+		state, ev, dom_child_handle(domain), &state->sid, &state->sids);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
diff --git a/source3/winbindd/wb_next_grent.c b/source3/winbindd/wb_next_grent.c
index 7eec3e0..54c4c1c 100644
--- a/source3/winbindd/wb_next_grent.c
+++ b/source3/winbindd/wb_next_grent.c
@@ -70,7 +70,7 @@ struct tevent_req *wb_next_grent_send(TALLOC_CTX *mem_ctx,
 			return tevent_req_post(req, ev);
 		}
 		subreq = dcerpc_wbint_QueryGroupList_send(
-			state, state->ev, state->gstate->domain->child.binding_handle,
+			state, state->ev, dom_child_handle(state->gstate->domain),
 			&state->next_groups);
 		if (tevent_req_nomem(subreq, req)) {
 			return tevent_req_post(req, ev);
@@ -134,7 +134,7 @@ static void wb_next_grent_fetch_done(struct tevent_req *subreq)
 			return;
 		}
 		subreq = dcerpc_wbint_QueryGroupList_send(
-			state, state->ev, state->gstate->domain->child.binding_handle,
+			state, state->ev, dom_child_handle(state->gstate->domain),
 			&state->next_groups);
 		if (tevent_req_nomem(subreq, req)) {
 			return;
diff --git a/source3/winbindd/wb_query_user_list.c b/source3/winbindd/wb_query_user_list.c
index c4eb200..abbf766 100644
--- a/source3/winbindd/wb_query_user_list.c
+++ b/source3/winbindd/wb_query_user_list.c
@@ -41,7 +41,7 @@ struct tevent_req *wb_query_user_list_send(TALLOC_CTX *mem_ctx,
 	}
 
 	subreq = dcerpc_wbint_QueryUserList_send(state, ev,
-						 domain->child.binding_handle,
+						 dom_child_handle(domain),
 						 &state->users);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
diff --git a/source3/winbindd/wb_queryuser.c b/source3/winbindd/wb_queryuser.c
index 870bfd3..33416b9 100644
--- a/source3/winbindd/wb_queryuser.c
+++ b/source3/winbindd/wb_queryuser.c
@@ -54,7 +54,7 @@ struct tevent_req *wb_queryuser_send(TALLOC_CTX *mem_ctx,
 		return tevent_req_post(req, ev);
 	}
 
-	subreq = dcerpc_wbint_QueryUser_send(state, ev, domain->child.binding_handle,
+	subreq = dcerpc_wbint_QueryUser_send(state, ev, dom_child_handle(domain),
 					     &state->sid, state->info);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
diff --git a/source3/winbindd/wb_seqnum.c b/source3/winbindd/wb_seqnum.c
index 0a314e7..4a92e03 100644
--- a/source3/winbindd/wb_seqnum.c
+++ b/source3/winbindd/wb_seqnum.c
@@ -39,7 +39,7 @@ struct tevent_req *wb_seqnum_send(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 	subreq = dcerpc_wbint_QuerySequenceNumber_send(
-		state, ev, domain->child.binding_handle, &state->seqnum);
+		state, ev, dom_child_handle(domain), &state->seqnum);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index d276b86..3217acc 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -205,7 +205,7 @@ struct winbindd_domain {
 
 	/* The child pid we're talking to */
 
-	struct winbindd_child child;
+	struct winbindd_child *children;
 
 	/* Callback we use to try put us back online. */
 
diff --git a/source3/winbindd/winbindd_change_machine_acct.c b/source3/winbindd/winbindd_change_machine_acct.c
index ad050ad..a5514e2 100644
--- a/source3/winbindd/winbindd_change_machine_acct.c
+++ b/source3/winbindd/winbindd_change_machine_acct.c
@@ -58,7 +58,7 @@ struct tevent_req *winbindd_change_machine_acct_send(TALLOC_CTX *mem_ctx,
 	}
 
 	subreq = dcerpc_wbint_ChangeMachineAccount_send(state, ev,
-							domain->child.binding_handle);
+							dom_child_handle(domain));
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
diff --git a/source3/winbindd/winbindd_check_machine_acct.c b/source3/winbindd/winbindd_check_machine_acct.c
index 6d969c9..2793701 100644
--- a/source3/winbindd/winbindd_check_machine_acct.c
+++ b/source3/winbindd/winbindd_check_machine_acct.c
@@ -62,7 +62,7 @@ struct tevent_req *winbindd_check_machine_acct_send(TALLOC_CTX *mem_ctx,
 	}
 
 	subreq = dcerpc_wbint_CheckMachineAccount_send(state, ev,
-						       domain->child.binding_handle);
+						       dom_child_handle(domain));
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
diff --git a/source3/winbindd/winbindd_domain.c b/source3/winbindd/winbindd_domain.c
index cd33708..e998275 100644
--- a/source3/winbindd/winbindd_domain.c
+++ b/source3/winbindd/winbindd_domain.c
@@ -69,6 +69,12 @@ static const struct winbindd_child_dispatch_table domain_dispatch_table[] = {
 
 void setup_domain_child(struct winbindd_domain *domain)
 {
-	setup_child(domain, &domain->child, domain_dispatch_table,
-		    "log.wb", domain->name);
+	int i;
+
+        for (i=0; i<lp_winbind_max_domain_connections(); i++) {
+                setup_child(domain, &domain->children[i],
+			    domain_dispatch_table,
+                            "log.wb", domain->name);
+		domain->children[i].domain = domain;
+	}
 }
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 344b7e4..a32459d 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -193,9 +193,47 @@ int wb_child_request_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
 	return 0;
 }
 
+static bool winbindd_child_busy(struct winbindd_child *child)
+{
+	return tevent_queue_length(child->queue) > 0;
+}
+
+static struct winbindd_child *find_idle_child(struct winbindd_domain *domain)
+{
+	int i;
+
+	for (i=0; i<lp_winbind_max_domain_connections(); i++) {
+		if (!winbindd_child_busy(&domain->children[i])) {
+			return &domain->children[i];
+		}
+	}
+
+	return NULL;
+}
+
+struct winbindd_child *choose_domain_child(struct winbindd_domain *domain)
+{
+	struct winbindd_child *result;
+
+	result = find_idle_child(domain);
+	if (result != NULL) {
+		return result;
+	}
+	return &domain->children[rand() % lp_winbind_max_domain_connections()];
+}
+
+struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain)
+{
+	struct winbindd_child *child;
+
+	child = choose_domain_child(domain);
+	return child->binding_handle;
+}
+
 struct wb_domain_request_state {
 	struct tevent_context *ev;
 	struct winbindd_domain *domain;
+	struct winbindd_child *child;
 	struct winbindd_request *request;
 	struct winbindd_request *init_req;
 	struct winbindd_response *response;
@@ -219,8 +257,10 @@ struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
 		return NULL;
 	}
 
+	state->child = choose_domain_child(domain);
+
 	if (domain->initialized) {
-		subreq = wb_child_request_send(state, ev, &domain->child,
+		subreq = wb_child_request_send(state, ev, state->child,
 					       request);
 		if (tevent_req_nomem(subreq, req)) {
 			return tevent_req_post(req, ev);
@@ -245,7 +285,7 @@ struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
 		state->init_req->data.init_conn.is_primary = domain->primary;
 		fstrcpy(state->init_req->data.init_conn.dcname, "");
 
-		subreq = wb_child_request_send(state, ev, &domain->child,
+		subreq = wb_child_request_send(state, ev, state->child,
 					       state->init_req);
 		if (tevent_req_nomem(subreq, req)) {
 			return tevent_req_post(req, ev);
@@ -266,7 +306,7 @@ struct tevent_req *wb_domain_request_send(TALLOC_CTX *mem_ctx,
 	state->init_req->cmd = WINBINDD_GETDCNAME;
 	fstrcpy(state->init_req->domain_name, domain->name);
 
-	subreq = wb_child_request_send(state, ev, &domain->child, request);
+	subreq = wb_child_request_send(state, ev, state->child, request);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
@@ -297,7 +337,7 @@ static void wb_domain_request_gotdc(struct tevent_req *subreq)
 
 	TALLOC_FREE(response);
 
-	subreq = wb_child_request_send(state, state->ev, &state->domain->child,
+	subreq = wb_child_request_send(state, state->ev, state->child,
 				       state->init_req);
 	if (tevent_req_nomem(subreq, req)) {
 		return;
@@ -337,7 +377,7 @@ static void wb_domain_request_initialized(struct tevent_req *subreq)
 
 	TALLOC_FREE(response);
 
-	subreq = wb_child_request_send(state, state->ev, &state->domain->child,
+	subreq = wb_child_request_send(state, state->ev, state->child,
 				       state->request);
 	if (tevent_req_nomem(subreq, req)) {
 		return;
diff --git a/source3/winbindd/winbindd_list_groups.c b/source3/winbindd/winbindd_list_groups.c
index 4236794..2e2c70a 100644
--- a/source3/winbindd/winbindd_list_groups.c
+++ b/source3/winbindd/winbindd_list_groups.c
@@ -91,7 +91,7 @@ struct tevent_req *winbindd_list_groups_send(TALLOC_CTX *mem_ctx,
 		struct winbindd_list_groups_domstate *d = &state->domains[i];
 
 		d->subreq = dcerpc_wbint_QueryGroupList_send(
-			state->domains, ev, d->domain->child.binding_handle,
+			state->domains, ev, dom_child_handle(d->domain),
 			&d->groups);
 		if (tevent_req_nomem(d->subreq, req)) {
 			TALLOC_FREE(state->domains);
diff --git a/source3/winbindd/winbindd_list_users.c b/source3/winbindd/winbindd_list_users.c
index 18b8fdd..54e0106 100644
--- a/source3/winbindd/winbindd_list_users.c
+++ b/source3/winbindd/winbindd_list_users.c
@@ -91,7 +91,7 @@ struct tevent_req *winbindd_list_users_send(TALLOC_CTX *mem_ctx,
 		struct winbindd_list_users_domstate *d = &state->domains[i];
 
 		d->subreq = dcerpc_wbint_QueryUserList_send(
-			state->domains, ev, d->domain->child.binding_handle,
+			state->domains, ev, dom_child_handle(d->domain),
 			&d->users);
 		if (tevent_req_nomem(d->subreq, req)) {
 			TALLOC_FREE(state->domains);
diff --git a/source3/winbindd/winbindd_lookuprids.c b/source3/winbindd/winbindd_lookuprids.c
index b921818..738adba 100644
--- a/source3/winbindd/winbindd_lookuprids.c
+++ b/source3/winbindd/winbindd_lookuprids.c
@@ -84,7 +84,7 @@ struct tevent_req *winbindd_lookuprids_send(TALLOC_CTX *mem_ctx,
 	}
 
 	subreq = dcerpc_wbint_LookupRids_send(
-		state, ev, domain->child.binding_handle, &state->rids,
+		state, ev, dom_child_handle(domain), &state->rids,
 		&state->domain_name, &state->names);
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
diff --git a/source3/winbindd/winbindd_ndr.c b/source3/winbindd/winbindd_ndr.c
index 396aa06..94aa7eb 100644
--- a/source3/winbindd/winbindd_ndr.c
+++ b/source3/winbindd/winbindd_ndr.c
@@ -120,6 +120,7 @@ void ndr_print_winbindd_domain(struct ndr_print *ndr,
 			       const char *name,
 			       const struct winbindd_domain *r)
 {
+	int i;
 	if (!r) {
 		return;
 	}
@@ -150,7 +151,9 @@ void ndr_print_winbindd_domain(struct ndr_print *ndr,
 	ndr_print_uint32(ndr, "sequence_number", r->sequence_number);
 	ndr_print_NTSTATUS(ndr, "last_status", r->last_status);
 	ndr_print_winbindd_cm_conn(ndr, "conn", &r->conn);
-	ndr_print_winbindd_child(ndr, "child", &r->child);
+	for (i=0; i<lp_winbind_max_domain_connections(); i++) {
+		ndr_print_winbindd_child(ndr, "children", &r->children[i]);
+	}
 	ndr_print_uint32(ndr, "check_online_timeout", r->check_online_timeout);
 	ndr_print_ptr(ndr, "check_online_event", r->check_online_event);
 	ndr->depth--;
diff --git a/source3/winbindd/winbindd_ping_dc.c b/source3/winbindd/winbindd_ping_dc.c
index 36c4def..2304828 100644
--- a/source3/winbindd/winbindd_ping_dc.c
+++ b/source3/winbindd/winbindd_ping_dc.c
@@ -61,7 +61,7 @@ struct tevent_req *winbindd_ping_dc_send(TALLOC_CTX *mem_ctx,
 		return tevent_req_post(req, ev);
 	}
 
-	subreq = dcerpc_wbint_PingDc_send(state, ev, domain->child.binding_handle);
+	subreq = dcerpc_wbint_PingDc_send(state, ev, dom_child_handle(domain));
 	if (tevent_req_nomem(subreq, req)) {
 		return tevent_req_post(req, ev);
 	}
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 5cb6c4c..c822baa 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -227,6 +227,9 @@ void setup_domain_child(struct winbindd_domain *domain);
 
 /* The following definitions come from winbindd/winbindd_dual.c  */
 
+struct dcerpc_binding_handle *dom_child_handle(struct winbindd_domain *domain);
+struct winbindd_child *choose_domain_child(struct winbindd_domain *domain);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list