From b2ff8a26636abb49277630846bd7a2a6b9044ad8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 20 Aug 2007 12:45:09 +0000 Subject: r24579: Merge error reporting to the end of winbindd_pam_auth(). Guenther (This used to be commit d5bd8b1d618828fe390ca76120863316606dc250) --- source3/nsswitch/winbindd_pam.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c index 2c0017cbce..b0a14ae4e9 100644 --- a/source3/nsswitch/winbindd_pam.c +++ b/source3/nsswitch/winbindd_pam.c @@ -583,6 +583,7 @@ void winbindd_pam_auth(struct winbindd_cli_state *state) { struct winbindd_domain *domain; fstring name_domain, name_user; + NTSTATUS result; /* Ensure null termination */ state->request.data.auth.user @@ -601,30 +602,27 @@ void winbindd_pam_auth(struct winbindd_cli_state *state) if (!canonicalize_username(state->request.data.auth.user, name_domain, name_user)) { - set_auth_errors(&state->response, NT_STATUS_NO_SUCH_USER); - DEBUG(5, ("Plain text authentication for %s returned %s " - "(PAM: %d)\n", - state->request.data.auth.user, - state->response.data.auth.nt_status_string, - state->response.data.auth.pam_error)); - request_error(state); - return; + result = NT_STATUS_NO_SUCH_USER; + goto done; } domain = find_auth_domain(state, name_domain); if (domain == NULL) { - set_auth_errors(&state->response, NT_STATUS_NO_SUCH_USER); - DEBUG(5, ("Plain text authentication for %s returned %s " - "(PAM: %d)\n", - state->request.data.auth.user, - state->response.data.auth.nt_status_string, - state->response.data.auth.pam_error)); - request_error(state); - return; + result = NT_STATUS_NO_SUCH_USER; + goto done; } sendto_domain(state, domain); + return; + done: + set_auth_errors(&state->response, result); + DEBUG(5, ("Plain text authentication for %s returned %s " + "(PAM: %d)\n", + state->request.data.auth.user, + state->response.data.auth.nt_status_string, + state->response.data.auth.pam_error)); + request_error(state); } NTSTATUS winbindd_dual_pam_auth_cached(struct winbindd_domain *domain, -- cgit