pam/pam-0.99.8.1-audit-no-log.patch

32 lines
894 B
Diff
Raw Normal View History

diff -up Linux-PAM-0.99.8.1/libpam/pam_audit.c.no-log Linux-PAM-0.99.8.1/libpam/pam_audit.c
--- Linux-PAM-0.99.8.1/libpam/pam_audit.c.no-log 2007-07-18 10:53:35.000000000 +0200
+++ Linux-PAM-0.99.8.1/libpam/pam_audit.c 2007-08-13 10:59:40.000000000 +0200
@@ -42,18 +42,17 @@ _pam_audit_writelog(pam_handle_t *pamh,
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;
}
int