summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-08-19 14:52:24 +0200
committerGünther Deschner <gd@samba.org>2008-10-10 15:42:23 +0200
commite8fe6661b4bbf338f46c52cb12c7bdb04037f297 (patch)
tree18f0d5b154002e23a3544b2ed551bd7221333c70 /source3/nsswitch
parent9448520828bbd78f34d027fd1801467395449b7c (diff)
downloadsamba-e8fe6661b4bbf338f46c52cb12c7bdb04037f297.tar.gz
samba-e8fe6661b4bbf338f46c52cb12c7bdb04037f297.tar.bz2
samba-e8fe6661b4bbf338f46c52cb12c7bdb04037f297.zip
pam_winbind: fix wbc_auth_error_to_pam_error().
Guenther
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/pam_winbind.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/source3/nsswitch/pam_winbind.c b/source3/nsswitch/pam_winbind.c
index 43157b7727..cac8550e60 100644
--- a/source3/nsswitch/pam_winbind.c
+++ b/source3/nsswitch/pam_winbind.c
@@ -733,7 +733,8 @@ static int pam_winbind_request(struct pwb_context *ctx,
static int pam_winbind_request_log(struct pwb_context *ctx,
int retval,
- const char *user)
+ const char *user,
+ const char *fn)
{
switch (retval) {
case PAM_AUTH_ERR:
@@ -766,24 +767,19 @@ static int pam_winbind_request_log(struct pwb_context *ctx,
return retval;
case PAM_SUCCESS:
/* Otherwise, the authentication looked good */
-#if 0
- switch (req_type) {
- case WINBINDD_PAM_AUTH:
- _pam_log(ctx, LOG_NOTICE,
- "user '%s' granted access", user);
- break;
- default:
- _pam_log(ctx, LOG_NOTICE,
- "user '%s' OK", user);
- break;
+ if (strcmp(fn, "wbcLogonUser") == 0) {
+ _pam_log(ctx, LOG_NOTICE,
+ "user '%s' granted access", user);
+ } else {
+ _pam_log(ctx, LOG_NOTICE,
+ "user '%s' OK", user);
}
-#endif
return retval;
default:
/* we don't know anything about this return value */
_pam_log(ctx, LOG_ERR,
- "internal module error (retval = %d, user = '%s')",
- retval, user);
+ "internal module error (retval = %s(%d), user = '%s')",
+ _pam_error_code_str(retval), retval, user);
return retval;
}
}
@@ -800,7 +796,7 @@ static int wbc_auth_error_to_pam_error(struct pwb_context *ctx,
_pam_log_debug(ctx, LOG_DEBUG, "request %s succeeded",
fn);
ret = PAM_SUCCESS;
- return pam_winbind_request_log(ctx, ret, username);
+ return pam_winbind_request_log(ctx, ret, username, fn);
}
if (e) {
@@ -816,17 +812,17 @@ static int wbc_auth_error_to_pam_error(struct pwb_context *ctx,
e->nt_string,
e->display_string);
ret = e->pam_error;
- return pam_winbind_request_log(ctx, ret, username);
+ return pam_winbind_request_log(ctx, ret, username, fn);
}
_pam_log(ctx, LOG_ERR, "request %s failed, but PAM error 0!", fn);
ret = PAM_SERVICE_ERR;
- return pam_winbind_request_log(ctx, ret, username);
+ return pam_winbind_request_log(ctx, ret, username, fn);
}
ret = wbc_error_to_pam_error(status);
- return pam_winbind_request_log(ctx, ret, username);
+ return pam_winbind_request_log(ctx, ret, username, fn);
}