]> git.pld-linux.org Git - packages/pam.git/blame - pam-audit-no-log.patch
- bugfixes/safe features from FC
[packages/pam.git] / pam-audit-no-log.patch
CommitLineData
bd9a1e0d
JR
1Bugzilla Bug 249870: crond: PAM audit_log_acct_message() failed: Operation not permitted
2
3The problem is the pam syslog message is sometimes error and sometimes not
4depending on various things like which service generated it and in what pam
5function call.
6diff -up Linux-PAM-0.99.8.1/libpam/pam_audit.c.no-log Linux-PAM-0.99.8.1/libpam/pam_audit.c
7--- Linux-PAM-0.99.8.1/libpam/pam_audit.c.no-log 2007-07-18 10:53:35.000000000 +0200
8+++ Linux-PAM-0.99.8.1/libpam/pam_audit.c 2007-08-13 10:59:40.000000000 +0200
9@@ -42,18 +42,17 @@ _pam_audit_writelog(pam_handle_t *pamh,
10 best to fix it. */
11 errno = -rc;
12
13- if (rc < 0 && errno != old_errno)
14- {
15- old_errno = errno;
16- pam_syslog (pamh, LOG_CRIT, "audit_log_acct_message() failed: %m");
17- }
18-
19 pamh->audit_state |= PAMAUDIT_LOGGED;
20
21- if (rc == -EPERM && getuid () != 0)
22- return 0;
23- else
24- return rc;
25+ if (rc < 0) {
26+ if (rc == -EPERM && getuid() != 0)
27+ return 0;
28+ if (errno != old_errno) {
29+ old_errno = errno;
30+ pam_syslog (pamh, LOG_CRIT, "audit_log_acct_message() failed: %m");
31+ }
32+ }
33+ return rc;
34 }
35
36 int
This page took 0.055432 seconds and 4 git commands to generate.