From fad82e8999e790899083f9e22a1841148d746df6 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 29 Apr 2003 19:12:07 +1000 Subject: - (djm) Add back radix.o (used by AFS support), after it went missing from Makefile many moons ago - (djm) Apply "owl-always-auth" patch from Openwall/Solar Designer - (djm) Fix blibpath specification for AIX/gcc - (djm) Some systems have basename in -lgen. Fix from ayamura@ayamura.org --- auth-pam.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'auth-pam.c') diff --git a/auth-pam.c b/auth-pam.c index b29444e8..cb57ba11 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -38,7 +38,7 @@ extern char *__progname; extern int use_privsep; -RCSID("$Id: auth-pam.c,v 1.56 2003/04/09 10:59:48 djm Exp $"); +RCSID("$Id: auth-pam.c,v 1.55.4.1 2003/04/29 09:12:08 djm Exp $"); #define NEW_AUTHTOK_MSG \ "Warning: Your password has expired, please change it now." @@ -182,7 +182,7 @@ void do_pam_cleanup_proc(void *context) if (__pamh && session_opened) { pam_retval = pam_close_session(__pamh, 0); if (pam_retval != PAM_SUCCESS) - logit("Cannot close PAM session[%d]: %.200s", + log("Cannot close PAM session[%d]: %.200s", pam_retval, PAM_STRERROR(__pamh, pam_retval)); } @@ -196,12 +196,12 @@ void do_pam_cleanup_proc(void *context) if (__pamh) { pam_retval = pam_end(__pamh, pam_retval); if (pam_retval != PAM_SUCCESS) - logit("Cannot release PAM authentication[%d]: %.200s", + log("Cannot release PAM authentication[%d]: %.200s", pam_retval, PAM_STRERROR(__pamh, pam_retval)); } } -/* Attempt password authentation using PAM */ +/* Attempt password authentication using PAM */ int auth_pam_password(Authctxt *authctxt, const char *password) { extern ServerOptions options; @@ -215,13 +215,13 @@ int auth_pam_password(Authctxt *authctxt, const char *password) pamstate = INITIAL_LOGIN; pam_retval = do_pam_authenticate( options.permit_empty_passwd == 0 ? PAM_DISALLOW_NULL_AUTHTOK : 0); - if (pam_retval == PAM_SUCCESS) { - debug("PAM Password authentication accepted for " - "user \"%.100s\"", pw->pw_name); + if (pam_retval == PAM_SUCCESS && pw) { + debug("PAM password authentication accepted for " + "%.100s", pw->pw_name); return 1; } else { - debug("PAM Password authentication for \"%.100s\" " - "failed[%d]: %s", pw->pw_name, pam_retval, + debug("PAM password authentication failed for " + "%.100s: %s", pw ? pw->pw_name : "an illegal user", PAM_STRERROR(__pamh, pam_retval)); return 0; } @@ -261,7 +261,7 @@ int do_pam_account(char *username, char *remote_user) break; #endif default: - logit("PAM rejected by account configuration[%d]: " + log("PAM rejected by account configuration[%d]: " "%.200s", pam_retval, PAM_STRERROR(__pamh, pam_retval)); return(0); -- cgit v1.2.3