Skip to content

Commit

Permalink
winbind: add idmap_child_handle() and use it instead of child->bindin…
Browse files Browse the repository at this point in the history
…g_handle

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292

Signed-off-by: Stefan Metzmacher <[email protected]>
Reviewed-by: Volker Lendecke <[email protected]>
  • Loading branch information
metze-samba committed Feb 23, 2018
1 parent 1f41193 commit c2d78a0
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
6 changes: 3 additions & 3 deletions source3/winbindd/wb_sids2xids.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions source3/winbindd/winbindd_allocate_gid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions source3/winbindd/winbindd_allocate_uid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions source3/winbindd/winbindd_idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions source3/winbindd/winbindd_proto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c2d78a0

Please sign in to comment.