diff --git a/please.c b/please.c index 4aff59d..193015e 100644 --- a/please.c +++ b/please.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -67,6 +68,11 @@ int authenticate() PAM_RETURN_ON_FAILURE; pam_return: + if(pam_err != PAM_SUCCESS) { + openlog("please", 0, LOG_AUTH); + syslog(LOG_NOTICE, pam_strerror(pamh, pam_err)); + closelog(); + } pam_end(pamh, pam_err); return pam_err == PAM_SUCCESS ? 0 : -1; }