diff options
author | Thorsten Kukuk <kukuk@thkukuk.de> | 2006-12-12 15:58:01 +0000 |
---|---|---|
committer | Thorsten Kukuk <kukuk@thkukuk.de> | 2006-12-12 15:58:01 +0000 |
commit | 03209d3db52185b8c57ee0f5cccb18aa2c908122 (patch) | |
tree | d95892a508416f37a38e94465b028bb1cde379eb /libpam | |
parent | e648517eef968b1630f0e3cc0dd90a926868b28f (diff) | |
download | pam-03209d3db52185b8c57ee0f5cccb18aa2c908122.tar.gz pam-03209d3db52185b8c57ee0f5cccb18aa2c908122.tar.bz2 pam-03209d3db52185b8c57ee0f5cccb18aa2c908122.zip |
Relevant BUGIDs:
Purpose of commit: bugfix
Commit summary:
---------------
2006-12-12 Thorsten Kukuk <kukuk@thkukuk.de>
* libpam/pam_audit.c (_pam_audit_writelog): Print error
message on failure to syslog.
Diffstat (limited to 'libpam')
-rw-r--r-- | libpam/pam_audit.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libpam/pam_audit.c b/libpam/pam_audit.c index 4399e5c6..05be989c 100644 --- a/libpam/pam_audit.c +++ b/libpam/pam_audit.c @@ -22,18 +22,21 @@ #define PAMAUDIT_LOGGED 1 static int -_pam_audit_writelog(pam_handle_t *pamh, int audit_fd, int type, +_pam_audit_writelog(pam_handle_t *pamh, int audit_fd, int type, const char *message, int retval) { int rc; char buf[256]; - snprintf(buf, sizeof(buf), "PAM: %s acct=%s ", message, + snprintf(buf, sizeof(buf), "PAM: %s acct=%s ", message, (retval != PAM_USER_UNKNOWN && pamh->user) ? pamh->user : "?"); rc = audit_log_user_message( audit_fd, type, buf, pamh->rhost, NULL, pamh->tty, retval == PAM_SUCCESS ); + if (rc == -1) + pam_syslog(pamh, LOG_CRIT, "audit_log_user_message() failed: %m"); + pamh->audit_state |= PAMAUDIT_LOGGED; return rc; } @@ -59,7 +62,7 @@ _pam_auditlog(pam_handle_t *pamh, int action, int retval, int flags) pam_syslog(pamh, LOG_CRIT, "audit_open() failed: %m"); return PAM_SYSTEM_ERR; } - + switch (action) { case PAM_AUTHENTICATE: message = "authentication"; @@ -105,7 +108,7 @@ _pam_auditlog(pam_handle_t *pamh, int action, int retval, int flags) if (_pam_audit_writelog(pamh, audit_fd, type, message, retval) < 0) retval = PAM_SYSTEM_ERR; - + audit_close(audit_fd); return retval; } |