From 80187366f2679e5c43d21978d4c6b1f7beee503a Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Thu, 19 Apr 2001 23:52:45 +0000 Subject: Added error reporting to pam_session code. (This used to be commit 72812e4cf199d804418dc52cc0b0ba683b8a2e5c) --- source3/auth/pampass.c | 19 +++++++++++++++++++ source3/passdb/pampass.c | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) (limited to 'source3') diff --git a/source3/auth/pampass.c b/source3/auth/pampass.c index d9137045e2..277544ed91 100644 --- a/source3/auth/pampass.c +++ b/source3/auth/pampass.c @@ -287,6 +287,25 @@ static BOOL pam_account(pam_handle_t *pamh, char * user, char * password, BOOL p DEBUG(4,("PAM: Account Management SetCredentials for User: %s\n", user)); pam_error = pam_setcred(pamh, (PAM_ESTABLISH_CRED|PAM_SILENT)); + switch( pam_error ) { + case PAM_CRED_UNAVAIL: + DEBUG(0, ("PAM: Credentials not found for user:%s", user )); + break; + case PAM_CRED_EXPIRED: + DEBUG(0, ("PAM: Credentials for user: \"%s\" EXPIRED!", user )); + break; + case PAM_CRED_UNKNOWN: + DEBUG(0, ("PAM: User: \"%s\" is NOT known so can not set credentials!", user )); + break; + case PAM_CRED_UNKNOWN: + DEBUG(0, ("PAM: Unknown setcredentials error - unable to set credentials for %s", user )); + break; + case PAM_SUCCESS: + DEBUG(4, ("PAM: SetCredentials OK for User: %s\n", user)); + break; + default: + DEBUG(0, ("PAM: Error Condition Unknown in pam_setcred function call!")); + } if(!pam_error_handler(pamh, pam_error, "Set Credential Failure", 2)) { proc_pam_end(pamh); return False; diff --git a/source3/passdb/pampass.c b/source3/passdb/pampass.c index d9137045e2..277544ed91 100644 --- a/source3/passdb/pampass.c +++ b/source3/passdb/pampass.c @@ -287,6 +287,25 @@ static BOOL pam_account(pam_handle_t *pamh, char * user, char * password, BOOL p DEBUG(4,("PAM: Account Management SetCredentials for User: %s\n", user)); pam_error = pam_setcred(pamh, (PAM_ESTABLISH_CRED|PAM_SILENT)); + switch( pam_error ) { + case PAM_CRED_UNAVAIL: + DEBUG(0, ("PAM: Credentials not found for user:%s", user )); + break; + case PAM_CRED_EXPIRED: + DEBUG(0, ("PAM: Credentials for user: \"%s\" EXPIRED!", user )); + break; + case PAM_CRED_UNKNOWN: + DEBUG(0, ("PAM: User: \"%s\" is NOT known so can not set credentials!", user )); + break; + case PAM_CRED_UNKNOWN: + DEBUG(0, ("PAM: Unknown setcredentials error - unable to set credentials for %s", user )); + break; + case PAM_SUCCESS: + DEBUG(4, ("PAM: SetCredentials OK for User: %s\n", user)); + break; + default: + DEBUG(0, ("PAM: Error Condition Unknown in pam_setcred function call!")); + } if(!pam_error_handler(pamh, pam_error, "Set Credential Failure", 2)) { proc_pam_end(pamh); return False; -- cgit