summaryrefslogtreecommitdiff
path: root/source4/winbind/wb_pam_auth.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-24 13:15:42 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-25 01:39:41 +0200
commit0ccdaa940a80181d1f263386324668a0a715dbf9 (patch)
tree77ceaa727f753395515e06ad711eba7bc3e36e2f /source4/winbind/wb_pam_auth.c
parentd3756d87389fb7111c35e1e01f23abfb13f814a7 (diff)
downloadsamba-0ccdaa940a80181d1f263386324668a0a715dbf9.tar.gz
samba-0ccdaa940a80181d1f263386324668a0a715dbf9.tar.bz2
samba-0ccdaa940a80181d1f263386324668a0a715dbf9.zip
s4:winbind: convert wb_sam_logon_send/recv to tevent_req
metze
Diffstat (limited to 'source4/winbind/wb_pam_auth.c')
-rw-r--r--source4/winbind/wb_pam_auth.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source4/winbind/wb_pam_auth.c b/source4/winbind/wb_pam_auth.c
index bcbc6286b5..c84b51f4fe 100644
--- a/source4/winbind/wb_pam_auth.c
+++ b/source4/winbind/wb_pam_auth.c
@@ -54,7 +54,7 @@ struct pam_auth_crap_state {
* NTLM authentication.
*/
-static void pam_auth_crap_recv_logon(struct composite_context *ctx);
+static void pam_auth_crap_recv_logon(struct tevent_req *subreq);
struct composite_context *wb_cmd_pam_auth_crap_send(TALLOC_CTX *mem_ctx,
struct wbsrv_service *service,
@@ -66,10 +66,11 @@ struct composite_context *wb_cmd_pam_auth_crap_send(TALLOC_CTX *mem_ctx,
DATA_BLOB nt_resp,
DATA_BLOB lm_resp)
{
- struct composite_context *result, *ctx;
+ struct composite_context *result;
struct pam_auth_crap_state *state;
struct netr_NetworkInfo *ninfo;
DATA_BLOB tmp_nt_resp, tmp_lm_resp;
+ struct tevent_req *subreq;
result = composite_create(mem_ctx, service->task->event_ctx);
if (result == NULL) goto failed;
@@ -113,10 +114,11 @@ struct composite_context *wb_cmd_pam_auth_crap_send(TALLOC_CTX *mem_ctx,
state->unix_username = NULL;
- ctx = wb_sam_logon_send(mem_ctx, service, state->req);
- if (ctx == NULL) goto failed;
-
- composite_continue(result, ctx, pam_auth_crap_recv_logon, state);
+ subreq = wb_sam_logon_send(state,
+ service->task->event_ctx,
+ service, state->req);
+ if (subreq == NULL) goto failed;
+ tevent_req_set_callback(subreq, pam_auth_crap_recv_logon, state);
return result;
failed:
@@ -129,16 +131,17 @@ struct composite_context *wb_cmd_pam_auth_crap_send(TALLOC_CTX *mem_ctx,
Send of a SamLogon request to authenticate a user.
*/
-static void pam_auth_crap_recv_logon(struct composite_context *ctx)
+static void pam_auth_crap_recv_logon(struct tevent_req *subreq)
{
DATA_BLOB tmp_blob;
enum ndr_err_code ndr_err;
struct netr_SamBaseInfo *base;
struct pam_auth_crap_state *state =
- talloc_get_type(ctx->async.private_data,
+ tevent_req_callback_data(subreq,
struct pam_auth_crap_state);
- state->ctx->status = wb_sam_logon_recv(ctx, state, state->req);
+ state->ctx->status = wb_sam_logon_recv(subreq, state, state->req);
+ TALLOC_FREE(subreq);
if (!composite_is_ok(state->ctx)) return;
ndr_err = ndr_push_struct_blob(