winbindd: call add_trusted_domain_from_auth() in winbindd_pam_auth_crap_done()
authorStefan Metzmacher <metze@samba.org>
Tue, 23 Jan 2018 21:00:35 +0000 (22:00 +0100)
committerRalph Boehme <slow@samba.org>
Sat, 10 Feb 2018 07:35:17 +0000 (08:35 +0100)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13262

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/winbindd/winbindd_pam_auth_crap.c

index eb4087b1c2cb19b62f15e2c4b39fbb56aaed4af2..fe0ce4ade62a4bdba1a6c31b70f77133ee5d97ea 100644 (file)
@@ -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);