1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:winbind: let wb_lsa_lookupnames_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:
Stefan Metzmacher 2014-01-14 12:11:17 +01:00 committed by Günther Deschner
parent 5559cdf5c2
commit ad14fb9545
2 changed files with 7 additions and 6 deletions

View File

@ -209,7 +209,8 @@ struct lsa_lookupnames_state {
static void lsa_lookupnames_recv_sids(struct tevent_req *subreq);
struct composite_context *wb_lsa_lookupnames_send(TALLOC_CTX *mem_ctx,
struct dcerpc_pipe *lsa_pipe,
struct tevent_context *ev,
struct dcerpc_binding_handle *lsa_binding,
struct policy_handle *handle,
uint32_t num_names,
const char **names)
@ -221,7 +222,7 @@ struct composite_context *wb_lsa_lookupnames_send(TALLOC_CTX *mem_ctx,
struct lsa_String *lsa_names;
uint32_t i;
result = composite_create(mem_ctx, lsa_pipe->conn->event_ctx);
result = composite_create(mem_ctx, ev);
if (result == NULL) goto failed;
state = talloc(result, struct lsa_lookupnames_state);
@ -254,9 +255,8 @@ struct composite_context *wb_lsa_lookupnames_send(TALLOC_CTX *mem_ctx,
state->r.out.sids = &state->sids;
state->r.out.domains = &state->domains;
subreq = dcerpc_lsa_LookupNames_r_send(state,
result->event_ctx,
lsa_pipe->binding_handle,
subreq = dcerpc_lsa_LookupNames_r_send(state, ev,
lsa_binding,
&state->r);
if (subreq == NULL) goto failed;
tevent_req_set_callback(subreq, lsa_lookupnames_recv_sids, state);

View File

@ -75,7 +75,8 @@ static void lookupname_recv_domain(struct composite_context *ctx)
state->ctx->status = wb_sid2domain_recv(ctx, &domain);
if (!composite_is_ok(state->ctx)) return;
ctx = wb_lsa_lookupnames_send(state, domain->libnet_ctx->lsa.pipe,
ctx = wb_lsa_lookupnames_send(state, state->ctx->event_ctx,
domain->libnet_ctx->lsa.lsa_handle,
&domain->libnet_ctx->lsa.handle, 1, &state->name);
composite_continue(state->ctx, ctx, lookupname_recv_sids, state);
}