From eaad7add88d618f1a40120b6ca5e8f98819a1161 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 4 Feb 2009 12:23:55 -0500 Subject: [PATCH] auth_debug_passwords=yes: Log password for PAM lookups. --HG-- branch : HEAD --- src/auth/passdb-pam.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/auth/passdb-pam.c b/src/auth/passdb-pam.c index 65dfcbd116..ee05c053d2 100644 --- a/src/auth/passdb-pam.c +++ b/src/auth/passdb-pam.c @@ -178,12 +178,16 @@ static int try_pam_auth(struct auth_request *request, pam_handle_t *pamh, /* log this as error, since it probably is */ str = t_strdup_printf("%s (%s missing?)", str, path); auth_request_log_error(request, "pam", "%s", str); - } else { - if (status == PAM_AUTH_ERR) { - str = t_strconcat(str, " (password mismatch?)", - NULL); + } else if (status == PAM_AUTH_ERR) { + str = t_strconcat(str, " (password mismatch?)", NULL); + if (request->auth->verbose_debug_passwords) { + str = t_strconcat(str, " (given password: ", + request->mech_password, + ")", NULL); } auth_request_log_info(request, "pam", "%s", str); + } else { + auth_request_log_info(request, "pam", "%s", str); } return status; } -- 2.47.3