- fix auth regression when uid != 0 from previous build (#251804)

This commit is contained in:
Tomáš Mráz 2007-08-13 09:05:04 +00:00
parent ecf62ebc17
commit 81e34ba414
2 changed files with 24 additions and 15 deletions

View File

@ -1,26 +1,30 @@
diff -up Linux-PAM-0.99.8.1/libpam/pam_audit.c.no-log Linux-PAM-0.99.8.1/libpam/pam_audit.c 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.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 +++ Linux-PAM-0.99.8.1/libpam/pam_audit.c 2007-08-13 10:59:40.000000000 +0200
@@ -42,18 +42,16 @@ _pam_audit_writelog(pam_handle_t *pamh, @@ -42,18 +42,17 @@ _pam_audit_writelog(pam_handle_t *pamh,
best to fix it. */ best to fix it. */
errno = -rc; errno = -rc;
+ pamh->audit_state |= PAMAUDIT_LOGGED; - if (rc < 0 && errno != old_errno)
+ - {
if (rc < 0 && errno != old_errno) - old_errno = errno;
{ - pam_syslog (pamh, LOG_CRIT, "audit_log_acct_message() failed: %m");
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;
- -
pamh->audit_state |= PAMAUDIT_LOGGED;
- if (rc == -EPERM && getuid () != 0) - if (rc == -EPERM && getuid () != 0)
- return 0; - return 0;
- else - else
- return rc; - 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; + return rc;
} }

View File

@ -11,8 +11,10 @@
Summary: A security tool which provides authentication for applications Summary: A security tool which provides authentication for applications
Name: pam Name: pam
Version: 0.99.8.1 Version: 0.99.8.1
Release: 3%{?dist} Release: 4%{?dist}
License: GPL or BSD # The library is BSD licensed with option to relicense as GPLv2+ - this option is redundant
# as the BSD license allows that anyway. pam_timestamp and pam_console modules are GPLv2+
License: BSD and GPLv2+
Group: System Environment/Base Group: System Environment/Base
Source0: http://ftp.us.kernel.org/pub/linux/libs/pam/pre/library/Linux-PAM-%{version}.tar.bz2 Source0: http://ftp.us.kernel.org/pub/linux/libs/pam/pre/library/Linux-PAM-%{version}.tar.bz2
Source1: http://ftp.us.kernel.org/pub/linux/libs/pam/pre/library/Linux-PAM-%{version}.tar.bz2.sign Source1: http://ftp.us.kernel.org/pub/linux/libs/pam/pre/library/Linux-PAM-%{version}.tar.bz2.sign
@ -386,6 +388,9 @@ fi
%doc doc/adg/*.txt doc/adg/html %doc doc/adg/*.txt doc/adg/html
%changelog %changelog
* Mon Aug 13 2007 Tomas Mraz <tmraz@redhat.com> 0.99.8.1-4
- fix auth regression when uid != 0 from previous build (#251804)
* Mon Aug 6 2007 Tomas Mraz <tmraz@redhat.com> 0.99.8.1-3 * Mon Aug 6 2007 Tomas Mraz <tmraz@redhat.com> 0.99.8.1-3
- updated db4 to 4.6.18 (#249740) - updated db4 to 4.6.18 (#249740)
- added user and new instance parameters to namespace init - added user and new instance parameters to namespace init