summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Terpstra <jht@samba.org>2001-04-19 23:52:45 +0000
committerJohn Terpstra <jht@samba.org>2001-04-19 23:52:45 +0000
commit80187366f2679e5c43d21978d4c6b1f7beee503a (patch)
tree90e070188b9439ca7f32f9fb2d669abab0adfd8d
parent0fc676c3354c1cf75732a1f0fea89a09f432a819 (diff)
downloadsamba-80187366f2679e5c43d21978d4c6b1f7beee503a.tar.gz
samba-80187366f2679e5c43d21978d4c6b1f7beee503a.tar.bz2
samba-80187366f2679e5c43d21978d4c6b1f7beee503a.zip
Added error reporting to pam_session code.
(This used to be commit 72812e4cf199d804418dc52cc0b0ba683b8a2e5c)
-rw-r--r--source3/auth/pampass.c19
-rw-r--r--source3/passdb/pampass.c19
2 files changed, 38 insertions, 0 deletions
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;