mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
s4:winbind: let wb_samr_userdomgroups_send() take tevent_context/dcerpc_binding_handle
This avoids usage/dereferencing 'struct dcerpc_pipe'. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
parent
ad14fb9545
commit
124a89698b
source4/winbind
@ -345,7 +345,7 @@ NTSTATUS wb_lsa_lookupnames_recv(struct composite_context *c,
|
||||
}
|
||||
struct samr_getuserdomgroups_state {
|
||||
struct composite_context *ctx;
|
||||
struct dcerpc_pipe *samr_pipe;
|
||||
struct dcerpc_binding_handle *samr_binding;
|
||||
|
||||
uint32_t num_rids;
|
||||
uint32_t *rids;
|
||||
@ -363,7 +363,8 @@ static void samr_usergroups_recv_groups(struct tevent_req *subreq);
|
||||
static void samr_usergroups_recv_close(struct tevent_req *subreq);
|
||||
|
||||
struct composite_context *wb_samr_userdomgroups_send(TALLOC_CTX *mem_ctx,
|
||||
struct dcerpc_pipe *samr_pipe,
|
||||
struct tevent_context *ev,
|
||||
struct dcerpc_binding_handle *samr_binding,
|
||||
struct policy_handle *domain_handle,
|
||||
uint32_t rid)
|
||||
{
|
||||
@ -371,7 +372,7 @@ struct composite_context *wb_samr_userdomgroups_send(TALLOC_CTX *mem_ctx,
|
||||
struct samr_getuserdomgroups_state *state;
|
||||
struct tevent_req *subreq;
|
||||
|
||||
result = composite_create(mem_ctx, samr_pipe->conn->event_ctx);
|
||||
result = composite_create(mem_ctx, ev);
|
||||
if (result == NULL) goto failed;
|
||||
|
||||
state = talloc(result, struct samr_getuserdomgroups_state);
|
||||
@ -379,7 +380,7 @@ struct composite_context *wb_samr_userdomgroups_send(TALLOC_CTX *mem_ctx,
|
||||
result->private_data = state;
|
||||
state->ctx = result;
|
||||
|
||||
state->samr_pipe = samr_pipe;
|
||||
state->samr_binding = samr_binding;
|
||||
|
||||
state->user_handle = talloc(state, struct policy_handle);
|
||||
if (state->user_handle == NULL) goto failed;
|
||||
@ -390,8 +391,8 @@ struct composite_context *wb_samr_userdomgroups_send(TALLOC_CTX *mem_ctx,
|
||||
state->o.out.user_handle = state->user_handle;
|
||||
|
||||
subreq = dcerpc_samr_OpenUser_r_send(state,
|
||||
result->event_ctx,
|
||||
state->samr_pipe->binding_handle,
|
||||
state->ctx->event_ctx,
|
||||
state->samr_binding,
|
||||
&state->o);
|
||||
if (subreq == NULL) goto failed;
|
||||
tevent_req_set_callback(subreq, samr_usergroups_recv_open, state);
|
||||
@ -420,7 +421,7 @@ static void samr_usergroups_recv_open(struct tevent_req *subreq)
|
||||
|
||||
subreq = dcerpc_samr_GetGroupsForUser_r_send(state,
|
||||
state->ctx->event_ctx,
|
||||
state->samr_pipe->binding_handle,
|
||||
state->samr_binding,
|
||||
&state->g);
|
||||
if (composite_nomem(subreq, state->ctx)) return;
|
||||
tevent_req_set_callback(subreq, samr_usergroups_recv_groups, state);
|
||||
@ -443,7 +444,7 @@ static void samr_usergroups_recv_groups(struct tevent_req *subreq)
|
||||
|
||||
subreq = dcerpc_samr_Close_r_send(state,
|
||||
state->ctx->event_ctx,
|
||||
state->samr_pipe->binding_handle,
|
||||
state->samr_binding,
|
||||
&state->c);
|
||||
if (composite_nomem(subreq, state->ctx)) return;
|
||||
tevent_req_set_callback(subreq, samr_usergroups_recv_close, state);
|
||||
|
@ -81,7 +81,8 @@ static void userdomgroups_recv_domain(struct composite_context *ctx)
|
||||
state->ctx->status = wb_sid2domain_recv(ctx, &domain);
|
||||
if (!composite_is_ok(state->ctx)) return;
|
||||
|
||||
ctx = wb_samr_userdomgroups_send(state, domain->libnet_ctx->samr.pipe,
|
||||
ctx = wb_samr_userdomgroups_send(state, state->ctx->event_ctx,
|
||||
domain->libnet_ctx->samr.samr_handle,
|
||||
&domain->libnet_ctx->samr.handle,
|
||||
state->user_rid);
|
||||
composite_continue(state->ctx, ctx, userdomgroups_recv_rids, state);
|
||||
|
Loading…
Reference in New Issue
Block a user