From: Stefan Metzmacher Date: Wed, 14 Feb 2018 12:24:54 +0000 (+0100) Subject: winbind: add locator_child_handle() and use it instead of child->binding_handle X-Git-Tag: ldb-1.3.2~46 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=44ebaaac8933f5fc16a043b8c15a9449746af47b winbind: add locator_child_handle() and use it instead of child->binding_handle BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292 Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- diff --git a/source3/winbindd/wb_dsgetdcname.c b/source3/winbindd/wb_dsgetdcname.c index 8bd74198bcb..2f450c7a2b4 100644 --- a/source3/winbindd/wb_dsgetdcname.c +++ b/source3/winbindd/wb_dsgetdcname.c @@ -37,7 +37,7 @@ struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx, { struct tevent_req *req, *subreq; struct wb_dsgetdcname_state *state; - struct winbindd_child *child; + struct dcerpc_binding_handle *child_binding_handle = NULL; struct GUID guid; struct GUID *guid_ptr = NULL; @@ -72,10 +72,10 @@ struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx, /* * We have to figure out the DC ourselves */ - child = locator_child(); + child_binding_handle = locator_child_handle(); } else { struct winbindd_domain *domain = find_our_domain(); - child = choose_domain_child(domain); + child_binding_handle = dom_child_handle(domain); } if (domain_guid != NULL) { @@ -85,7 +85,7 @@ struct tevent_req *wb_dsgetdcname_send(TALLOC_CTX *mem_ctx, } subreq = dcerpc_wbint_DsGetDcName_send( - state, ev, child->binding_handle, domain_name, guid_ptr, site_name, + state, ev, child_binding_handle, domain_name, guid_ptr, site_name, flags, &state->dcinfo); if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); diff --git a/source3/winbindd/winbindd_dsgetdcname.c b/source3/winbindd/winbindd_dsgetdcname.c index 8eb1de74d92..fd9270f106c 100644 --- a/source3/winbindd/winbindd_dsgetdcname.c +++ b/source3/winbindd/winbindd_dsgetdcname.c @@ -35,7 +35,7 @@ struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx, struct winbindd_request *request) { struct tevent_req *req, *subreq; - struct winbindd_child *child; + struct dcerpc_binding_handle *child_binding_handle = NULL; struct winbindd_dsgetdcname_state *state; struct GUID *guid_ptr = NULL; uint32_t ds_flags = 0; @@ -65,10 +65,10 @@ struct tevent_req *winbindd_dsgetdcname_send(TALLOC_CTX *mem_ctx, guid_ptr = &state->guid; } - child = locator_child(); + child_binding_handle = locator_child_handle(); subreq = dcerpc_wbint_DsGetDcName_send( - state, ev, child->binding_handle, + state, ev, child_binding_handle, request->data.dsgetdcname.domain_name, guid_ptr, request->data.dsgetdcname.site_name, ds_flags, &state->dc_info); diff --git a/source3/winbindd/winbindd_locator.c b/source3/winbindd/winbindd_locator.c index 59e8614fdbc..55b64555376 100644 --- a/source3/winbindd/winbindd_locator.c +++ b/source3/winbindd/winbindd_locator.c @@ -34,6 +34,11 @@ struct winbindd_child *locator_child(void) return &static_locator_child; } +struct dcerpc_binding_handle *locator_child_handle(void) +{ + return static_locator_child.binding_handle; +} + static const struct winbindd_child_dispatch_table locator_dispatch_table[] = { { .name = "PING", diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index 66d4a19617c..5d31490ff16 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -367,6 +367,7 @@ bool lp_scan_idmap_domains(bool (*fn)(const char *domname, void init_locator_child(void); struct winbindd_child *locator_child(void); +struct dcerpc_binding_handle *locator_child_handle(void); /* The following definitions come from winbindd/winbindd_misc.c */