summaryrefslogtreecommitdiff
path: root/source/nsswitch/winbindd_pam.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-09-22 01:21:12 +0000
committerGerald Carter <jerry@samba.org>2005-09-22 01:21:12 +0000
commitd826a6a9b1bb26565fe75781dddac782a4757e90 (patch)
treea0856da45373abedef604417f83489148dcf334e /source/nsswitch/winbindd_pam.c
parent7a42b3de7aea0f8afefefd90db7fe8f255163589 (diff)
downloadsamba-3.0.20rc2.tar.gz
r10400: commit merge patch from jrasamba-3.0.20rc2
libsmbsharemodes added (Jermey). Linux core dump fix from (James Peach). Linux quota fixes from (metze). krb5 memory leaks from (gd). Creds fix for winbindd and server (Jeremy). winbindd recursion fix (Jeremy). winbindd builtin fix (gd) universal pw error fixes (novell). dir logic fix (Jeremy). hide dotfiles fix (Jeremy) no write to read-only shares fix (?). exclusive open fix (vl). tdb reopen fix (tridge) status display open files fix (Jeremy) posix acl null pointer crash (?) posix acl mem leak (?) mount.cifs flag fix (sfrench) smbspool error message fix (?) libsmbclient comment fix (?). 64-bit error message fixes (Jeremy).
Diffstat (limited to 'source/nsswitch/winbindd_pam.c')
-rw-r--r--source/nsswitch/winbindd_pam.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/source/nsswitch/winbindd_pam.c b/source/nsswitch/winbindd_pam.c
index 4797ba79f4f..0b3c119afa0 100644
--- a/source/nsswitch/winbindd_pam.c
+++ b/source/nsswitch/winbindd_pam.c
@@ -404,12 +404,15 @@ enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain,
} while ( (attempts < 2) && retry );
- if (NT_STATUS_IS_OK(result) &&
- (!clnt_deal_with_creds(session_key, credentials,
- &ret_creds))) {
- DEBUG(3, ("DC %s sent wrong credentials\n",
- pipe_cli->cli->srv_name_slash));
- result = NT_STATUS_ACCESS_DENIED;
+ /* Only check creds if we got a connection. */
+ if (contact_domain->conn.cli &&
+ !(NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) ||
+ NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL))) {
+ if (!clnt_deal_with_creds(session_key, credentials, &ret_creds)) {
+ DEBUG(3, ("DC %s sent wrong credentials\n",
+ pipe_cli->cli->srv_name_slash));
+ result = NT_STATUS_ACCESS_DENIED;
+ }
}
if (NT_STATUS_IS_OK(result)) {
@@ -712,12 +715,15 @@ enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
} while ( (attempts < 2) && retry );
- if (NT_STATUS_IS_OK(result) &&
- (!clnt_deal_with_creds(session_key, credentials,
- &ret_creds))) {
- DEBUG(3, ("DC %s sent wrong credentials\n",
- pipe_cli->cli->srv_name_slash));
- result = NT_STATUS_ACCESS_DENIED;
+ /* Only check creds if we got a connection. */
+ if (contact_domain->conn.cli &&
+ !(NT_STATUS_EQUAL(result, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND) ||
+ (NT_STATUS_EQUAL(result, NT_STATUS_UNSUCCESSFUL)))) {
+ if (!clnt_deal_with_creds(session_key, credentials, &ret_creds)) {
+ DEBUG(3, ("DC %s sent wrong credentials\n",
+ pipe_cli->cli->srv_name_slash));
+ result = NT_STATUS_ACCESS_DENIED;
+ }
}
if (NT_STATUS_IS_OK(result)) {