From ad14fb95453a9c3a0902047520bb460eca181c31 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 14 Jan 2014 12:11:17 +0100 Subject: 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 Reviewed-by: Guenther Deschner --- source4/winbind/wb_async_helpers.c | 10 +++++----- source4/winbind/wb_cmd_lookupname.c | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'source4/winbind') diff --git a/source4/winbind/wb_async_helpers.c b/source4/winbind/wb_async_helpers.c index 816a930ffc..4ea528bf0f 100644 --- a/source4/winbind/wb_async_helpers.c +++ b/source4/winbind/wb_async_helpers.c @@ -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); diff --git a/source4/winbind/wb_cmd_lookupname.c b/source4/winbind/wb_cmd_lookupname.c index 5178187ea8..7761dcea4f 100644 --- a/source4/winbind/wb_cmd_lookupname.c +++ b/source4/winbind/wb_cmd_lookupname.c @@ -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); } -- cgit