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

s4:winbind/wb_sam_logon.c: make use of use tevent_req based dcerpc_binding_handle stubs

metze
This commit is contained in:
Stefan Metzmacher 2010-03-10 10:04:20 +01:00
parent 399cbb6479
commit e9cae3b5bc

View File

@ -42,7 +42,7 @@ struct wb_sam_logon_state {
};
static void wb_sam_logon_recv_domain(struct composite_context *ctx);
static void wb_sam_logon_recv_samlogon(struct rpc_request *req);
static void wb_sam_logon_recv_samlogon(struct tevent_req *subreq);
/*
Find the connection to the DC (or find an existing connection)
@ -77,8 +77,8 @@ static void wb_sam_logon_recv_domain(struct composite_context *creq)
{
struct wb_sam_logon_state *s = talloc_get_type(creq->async.private_data,
struct wb_sam_logon_state);
struct rpc_request *req;
struct wbsrv_domain *domain;
struct tevent_req *subreq;
s->ctx->status = wb_sid2domain_recv(creq, &domain);
if (!composite_is_ok(s->ctx)) return;
@ -112,8 +112,12 @@ static void wb_sam_logon_recv_domain(struct composite_context *creq)
s->r_mem_ctx = talloc_new(s);
if (composite_nomem(s->r_mem_ctx, s->ctx)) return;
req = dcerpc_netr_LogonSamLogon_send(domain->netlogon_pipe, s->r_mem_ctx, &s->r);
composite_continue_rpc(s->ctx, req, wb_sam_logon_recv_samlogon, s);
subreq = dcerpc_netr_LogonSamLogon_r_send(s,
s->ctx->event_ctx,
domain->netlogon_pipe->binding_handle,
&s->r);
if (composite_nomem(subreq, s->ctx)) return;
tevent_req_set_callback(subreq, wb_sam_logon_recv_samlogon, s);
}
/*
@ -121,12 +125,13 @@ static void wb_sam_logon_recv_domain(struct composite_context *creq)
Check the SamLogon reply and decrypt the session keys
*/
static void wb_sam_logon_recv_samlogon(struct rpc_request *req)
static void wb_sam_logon_recv_samlogon(struct tevent_req *subreq)
{
struct wb_sam_logon_state *s = talloc_get_type(req->async.private_data,
struct wb_sam_logon_state *s = tevent_req_callback_data(subreq,
struct wb_sam_logon_state);
s->ctx->status = dcerpc_netr_LogonSamLogon_recv(req);
s->ctx->status = dcerpc_netr_LogonSamLogon_r_recv(subreq, s->r_mem_ctx);
TALLOC_FREE(subreq);
if (!composite_is_ok(s->ctx)) return;
s->ctx->status = s->r.out.result;