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

28 lines
765 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-06 11:38:08.000000000 +0200
@@ -42,18 +42,16 @@ _pam_audit_writelog(pam_handle_t *pamh,
best to fix it. */
errno = -rc;
+ pamh->audit_state |= PAMAUDIT_LOGGED;
+
if (rc < 0 && errno != old_errno)
{
old_errno = errno;
+ if (rc == -EPERM && getuid () != 0)
+ return 0;
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;
+ return rc;
}
int