From 42e445396881c5b6651a0dde0abde3d6bb0740bf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 23 Jan 2018 22:00:35 +0100 Subject: [PATCH] winbindd: call add_trusted_domain_from_auth() in winbindd_pam_auth_crap_done() Bug: https://bugzilla.samba.org/show_bug.cgi?id=13262 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- source3/winbindd/winbindd_pam_auth_crap.c | 33 ++++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/source3/winbindd/winbindd_pam_auth_crap.c b/source3/winbindd/winbindd_pam_auth_crap.c index eb4087b1c2c..fe0ce4ade62 100644 --- a/source3/winbindd/winbindd_pam_auth_crap.c +++ b/source3/winbindd/winbindd_pam_auth_crap.c @@ -119,6 +119,23 @@ static void winbindd_pam_auth_crap_done(struct tevent_req *subreq) tevent_req_nterror(req, map_nt_error_from_unix(err)); return; } + + if (NT_STATUS_IS_OK(NT_STATUS(state->response->data.auth.nt_status)) && + (state->flags & WBFLAG_PAM_INFO3_TEXT)) + { + bool ok; + + ok = add_trusted_domain_from_auth( + state->response->data.auth.validation_level, + &state->response->data.auth.info3, + &state->response->data.auth.info6); + if (!ok) { + DBG_ERR("add_trusted_domain_from_auth failed\n"); + tevent_req_nterror(req, NT_STATUS_LOGON_FAILURE); + return; + } + } + tevent_req_done(req); } @@ -157,22 +174,6 @@ NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req, } - if (NT_STATUS_IS_OK(NT_STATUS(state->response->data.auth.nt_status)) && - (state->flags & WBFLAG_PAM_INFO3_TEXT)) - { - bool ok; - - ok = add_trusted_domain_from_auth( - state->response->data.auth.validation_level, - &state->response->data.auth.info3, - &state->response->data.auth.info6); - if (!ok) { - DBG_ERR("add_trusted_domain_from_auth failed\n"); - set_auth_errors(response, NT_STATUS_LOGON_FAILURE); - return NT_STATUS_LOGON_FAILURE; - } - } - *response = *state->response; response->result = WINBINDD_PENDING; state->response = talloc_move(response, &state->response); -- 2.34.1