From 6ccbba1cf178e9de46347e2f9df76f69aebcec20 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Thu, 21 Feb 2008 21:12:30 +0000 Subject: Relevant BUGIDs: rhbz#433459 Purpose of commit: bugfix Commit summary: --------------- 2008-02-21 Tomas Mraz * libpam/pam_audit.c (_pam_audit_writelog): Silence syslog message on non-error return. * modules/pam_unix/unix_chkpwd.c (main): Proceed as unprivileged user when checking password of another user. * modules/pam_unix/unix_update.c: Fix comment. --- libpam/pam_audit.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'libpam') diff --git a/libpam/pam_audit.c b/libpam/pam_audit.c index 6fd6a0c1..7f2e0b2c 100644 --- a/libpam/pam_audit.c +++ b/libpam/pam_audit.c @@ -43,18 +43,17 @@ _pam_audit_writelog(pam_handle_t *pamh, int audit_fd, int type, best to fix it. */ errno = -rc; - if (rc < 0 && errno != old_errno) - { - old_errno = errno; - pam_syslog (pamh, LOG_CRIT, "audit_log_acct_message() failed: %m"); - } - pamh->audit_state |= PAMAUDIT_LOGGED; - if (rc == -EPERM && getuid () != 0) - return 0; - else - return rc; + if (rc < 0) { + if (rc == -EPERM && getuid() != 0) + return 0; + if (errno != old_errno) { + old_errno = errno; + pam_syslog (pamh, LOG_CRIT, "audit_log_acct_message() failed: %m"); + } + } + return rc; } static int -- cgit v1.2.3