winbind: add locator_child_handle() and use it instead of child->binding_handle
authorStefan Metzmacher <metze@samba.org>
Wed, 14 Feb 2018 12:24:54 +0000 (13:24 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 23 Feb 2018 03:09:18 +0000 (04:09 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/winbindd/wb_dsgetdcname.c
source3/winbindd/winbindd_dsgetdcname.c
source3/winbindd/winbindd_locator.c
source3/winbindd/winbindd_proto.h

index 8bd74198bcb0900b2c32948877d3319c6711b6ac..2f450c7a2b4661031a317b6efbd7266b6ca4766c 100644 (file)
@@ -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);
index 8eb1de74d92b53408c3e28c8234a2ab6a88c5e14..fd9270f106c0a66af516265da89532f8e1c81923 100644 (file)
@@ -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);
index 59e8614fdbcc9a30807a4389d2bfb07cc131af89..55b64555376cebfe74d78d332f4bb1fb96f95393 100644 (file)
@@ -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",
index 66d4a19617ca9f59c4e034346c5ac734b8d6e3f1..5d31490ff162d0f69c8da89505f41266a5ea7fdb 100644 (file)
@@ -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  */