summaryrefslogtreecommitdiff
path: root/auth-pam.c
diff options
context:
space:
mode:
Diffstat (limited to 'auth-pam.c')
-rw-r--r--auth-pam.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/auth-pam.c b/auth-pam.c
index b29444e89..cb57ba110 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -38,7 +38,7 @@ extern char *__progname;
38 38
39extern int use_privsep; 39extern int use_privsep;
40 40
41RCSID("$Id: auth-pam.c,v 1.56 2003/04/09 10:59:48 djm Exp $"); 41RCSID("$Id: auth-pam.c,v 1.55.4.1 2003/04/29 09:12:08 djm Exp $");
42 42
43#define NEW_AUTHTOK_MSG \ 43#define NEW_AUTHTOK_MSG \
44 "Warning: Your password has expired, please change it now." 44 "Warning: Your password has expired, please change it now."
@@ -182,7 +182,7 @@ void do_pam_cleanup_proc(void *context)
182 if (__pamh && session_opened) { 182 if (__pamh && session_opened) {
183 pam_retval = pam_close_session(__pamh, 0); 183 pam_retval = pam_close_session(__pamh, 0);
184 if (pam_retval != PAM_SUCCESS) 184 if (pam_retval != PAM_SUCCESS)
185 logit("Cannot close PAM session[%d]: %.200s", 185 log("Cannot close PAM session[%d]: %.200s",
186 pam_retval, PAM_STRERROR(__pamh, pam_retval)); 186 pam_retval, PAM_STRERROR(__pamh, pam_retval));
187 } 187 }
188 188
@@ -196,12 +196,12 @@ void do_pam_cleanup_proc(void *context)
196 if (__pamh) { 196 if (__pamh) {
197 pam_retval = pam_end(__pamh, pam_retval); 197 pam_retval = pam_end(__pamh, pam_retval);
198 if (pam_retval != PAM_SUCCESS) 198 if (pam_retval != PAM_SUCCESS)
199 logit("Cannot release PAM authentication[%d]: %.200s", 199 log("Cannot release PAM authentication[%d]: %.200s",
200 pam_retval, PAM_STRERROR(__pamh, pam_retval)); 200 pam_retval, PAM_STRERROR(__pamh, pam_retval));
201 } 201 }
202} 202}
203 203
204/* Attempt password authentation using PAM */ 204/* Attempt password authentication using PAM */
205int auth_pam_password(Authctxt *authctxt, const char *password) 205int auth_pam_password(Authctxt *authctxt, const char *password)
206{ 206{
207 extern ServerOptions options; 207 extern ServerOptions options;
@@ -215,13 +215,13 @@ int auth_pam_password(Authctxt *authctxt, const char *password)
215 pamstate = INITIAL_LOGIN; 215 pamstate = INITIAL_LOGIN;
216 pam_retval = do_pam_authenticate( 216 pam_retval = do_pam_authenticate(
217 options.permit_empty_passwd == 0 ? PAM_DISALLOW_NULL_AUTHTOK : 0); 217 options.permit_empty_passwd == 0 ? PAM_DISALLOW_NULL_AUTHTOK : 0);
218 if (pam_retval == PAM_SUCCESS) { 218 if (pam_retval == PAM_SUCCESS && pw) {
219 debug("PAM Password authentication accepted for " 219 debug("PAM password authentication accepted for "
220 "user \"%.100s\"", pw->pw_name); 220 "%.100s", pw->pw_name);
221 return 1; 221 return 1;
222 } else { 222 } else {
223 debug("PAM Password authentication for \"%.100s\" " 223 debug("PAM password authentication failed for "
224 "failed[%d]: %s", pw->pw_name, pam_retval, 224 "%.100s: %s", pw ? pw->pw_name : "an illegal user",
225 PAM_STRERROR(__pamh, pam_retval)); 225 PAM_STRERROR(__pamh, pam_retval));
226 return 0; 226 return 0;
227 } 227 }
@@ -261,7 +261,7 @@ int do_pam_account(char *username, char *remote_user)
261 break; 261 break;
262#endif 262#endif
263 default: 263 default:
264 logit("PAM rejected by account configuration[%d]: " 264 log("PAM rejected by account configuration[%d]: "
265 "%.200s", pam_retval, PAM_STRERROR(__pamh, 265 "%.200s", pam_retval, PAM_STRERROR(__pamh,
266 pam_retval)); 266 pam_retval));
267 return(0); 267 return(0);