summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2018-02-14 13:24:54 +0100
committerStefan Metzmacher <metze@samba.org>2018-02-23 04:09:18 +0100
commitc2d78a0a0a3f9b9ade61cf707f23e59a1a16c61b (patch)
tree2b2140857e9a46be4a54d245f4c8afa00e968409
parent1f41193e005df37401a28004f0a95d4d73b98ccd (diff)
downloadsamba-c2d78a0a0a3f9b9ade61cf707f23e59a1a16c61b.tar.gz
winbind: add idmap_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 <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r--source3/winbindd/wb_sids2xids.c6
-rw-r--r--source3/winbindd/winbindd_allocate_gid.c6
-rw-r--r--source3/winbindd/winbindd_allocate_uid.c6
-rw-r--r--source3/winbindd/winbindd_idmap.c5
-rw-r--r--source3/winbindd/winbindd_proto.h1
5 files changed, 15 insertions, 9 deletions
diff --git a/source3/winbindd/wb_sids2xids.c b/source3/winbindd/wb_sids2xids.c
index b8ad300ba3c..c687f7064bb 100644
--- a/source3/winbindd/wb_sids2xids.c
+++ b/source3/winbindd/wb_sids2xids.c
@@ -167,7 +167,7 @@ static void wb_sids2xids_lookupsids_done(struct tevent_req *subreq)
req, struct wb_sids2xids_state);
struct lsa_RefDomainList *domains = NULL;
struct lsa_TransNameArray *names = NULL;
- struct winbindd_child *child;
+ struct dcerpc_binding_handle *child_binding_handle = NULL;
NTSTATUS status;
int i;
@@ -237,7 +237,7 @@ static void wb_sids2xids_lookupsids_done(struct tevent_req *subreq)
TALLOC_FREE(names);
TALLOC_FREE(domains);
- child = idmap_child();
+ child_binding_handle = idmap_child_handle();
state->dom_ids = wb_sids2xids_extract_for_domain_index(
state, &state->ids, state->dom_index);
@@ -252,7 +252,7 @@ static void wb_sids2xids_lookupsids_done(struct tevent_req *subreq)
};
subreq = dcerpc_wbint_Sids2UnixIDs_send(
- state, state->ev, child->binding_handle, &state->idmap_dom,
+ state, state->ev, child_binding_handle, &state->idmap_dom,
state->dom_ids);
if (tevent_req_nomem(subreq, req)) {
return;
diff --git a/source3/winbindd/winbindd_allocate_gid.c b/source3/winbindd/winbindd_allocate_gid.c
index a9236bbf23d..85aa1369473 100644
--- a/source3/winbindd/winbindd_allocate_gid.c
+++ b/source3/winbindd/winbindd_allocate_gid.c
@@ -34,7 +34,7 @@ struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
{
struct tevent_req *req, *subreq;
struct winbindd_allocate_gid_state *state;
- struct winbindd_child *child;
+ struct dcerpc_binding_handle *child_binding_handle = NULL;
req = tevent_req_create(mem_ctx, &state,
struct winbindd_allocate_gid_state);
@@ -44,9 +44,9 @@ struct tevent_req *winbindd_allocate_gid_send(TALLOC_CTX *mem_ctx,
DEBUG(3, ("allocate_gid\n"));
- child = idmap_child();
+ child_binding_handle = idmap_child_handle();
- subreq = dcerpc_wbint_AllocateGid_send(state, ev, child->binding_handle,
+ subreq = dcerpc_wbint_AllocateGid_send(state, ev, child_binding_handle,
&state->gid);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
diff --git a/source3/winbindd/winbindd_allocate_uid.c b/source3/winbindd/winbindd_allocate_uid.c
index 99c0bdac102..69ce61c872e 100644
--- a/source3/winbindd/winbindd_allocate_uid.c
+++ b/source3/winbindd/winbindd_allocate_uid.c
@@ -34,7 +34,7 @@ struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
{
struct tevent_req *req, *subreq;
struct winbindd_allocate_uid_state *state;
- struct winbindd_child *child;
+ struct dcerpc_binding_handle *child_binding_handle = NULL;
req = tevent_req_create(mem_ctx, &state,
struct winbindd_allocate_uid_state);
@@ -44,9 +44,9 @@ struct tevent_req *winbindd_allocate_uid_send(TALLOC_CTX *mem_ctx,
DEBUG(3, ("allocate_uid\n"));
- child = idmap_child();
+ child_binding_handle = idmap_child_handle();
- subreq = dcerpc_wbint_AllocateUid_send(state, ev, child->binding_handle,
+ subreq = dcerpc_wbint_AllocateUid_send(state, ev, child_binding_handle,
&state->uid);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
diff --git a/source3/winbindd/winbindd_idmap.c b/source3/winbindd/winbindd_idmap.c
index 028026087d6..2ee436bc7dc 100644
--- a/source3/winbindd/winbindd_idmap.c
+++ b/source3/winbindd/winbindd_idmap.c
@@ -34,6 +34,11 @@ struct winbindd_child *idmap_child(void)
return &static_idmap_child;
}
+struct dcerpc_binding_handle *idmap_child_handle(void)
+{
+ return static_idmap_child.binding_handle;
+}
+
static const struct winbindd_child_dispatch_table idmap_dispatch_table[] = {
{
.name = "PING",
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index d09176d954a..66d4a19617c 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -351,6 +351,7 @@ NTSTATUS winbindd_print_groupmembers(struct db_context *members,
void init_idmap_child(void);
struct winbindd_child *idmap_child(void);
+struct dcerpc_binding_handle *idmap_child_handle(void);
struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
const struct dom_sid *sid);
const char *idmap_config_const_string(const char *domname, const char *option,