fix #726980 - work properly when acl_get_fd is supported,
but acl_set_fd is not
This commit is contained in:
parent
5d6d8a191b
commit
8d1447c569
67
logrotate-3.8.0-handle-acl-not-supported.patch
Normal file
67
logrotate-3.8.0-handle-acl-not-supported.patch
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
Index: logrotate.c
|
||||||
|
===================================================================
|
||||||
|
--- logrotate.c (revision 335)
|
||||||
|
+++ logrotate.c (working copy)
|
||||||
|
@@ -410,13 +410,15 @@
|
||||||
|
}
|
||||||
|
if (prev_acl) {
|
||||||
|
if (acl_set_fd(outFile, prev_acl) == -1) {
|
||||||
|
- message(MESS_ERROR, "setting ACL for %s: %s\n",
|
||||||
|
- compressedName, strerror(errno));
|
||||||
|
- acl_free(prev_acl);
|
||||||
|
- prev_acl = NULL;
|
||||||
|
- close(inFile);
|
||||||
|
- close(outFile);
|
||||||
|
- return 1;
|
||||||
|
+ if (errno != ENOTSUP) {
|
||||||
|
+ message(MESS_ERROR, "setting ACL for %s: %s\n",
|
||||||
|
+ compressedName, strerror(errno));
|
||||||
|
+ acl_free(prev_acl);
|
||||||
|
+ prev_acl = NULL;
|
||||||
|
+ close(inFile);
|
||||||
|
+ close(outFile);
|
||||||
|
+ return 1;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
acl_free(prev_acl);
|
||||||
|
prev_acl = NULL;
|
||||||
|
@@ -624,14 +626,16 @@
|
||||||
|
}
|
||||||
|
#ifdef WITH_ACL
|
||||||
|
if (prev_acl) {
|
||||||
|
- if (acl_set_fd(fdsave, prev_acl) == -1) {
|
||||||
|
- message(MESS_ERROR, "setting ACL for %s: %s\n",
|
||||||
|
- saveLog, strerror(errno));
|
||||||
|
- acl_free(prev_acl);
|
||||||
|
- prev_acl = NULL;
|
||||||
|
- close(fdsave);
|
||||||
|
- close(fdcurr);
|
||||||
|
- return 1;
|
||||||
|
+ if ((fdsave, prev_acl) == -1) {
|
||||||
|
+ if (errno != ENOTSUP) {
|
||||||
|
+ message(MESS_ERROR, "setting ACL for %s: %s\n",
|
||||||
|
+ saveLog, strerror(errno));
|
||||||
|
+ acl_free(prev_acl);
|
||||||
|
+ prev_acl = NULL;
|
||||||
|
+ close(fdsave);
|
||||||
|
+ close(fdcurr);
|
||||||
|
+ return 1;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
acl_free(prev_acl);
|
||||||
|
prev_acl = NULL;
|
||||||
|
@@ -1331,9 +1335,11 @@
|
||||||
|
#ifdef WITH_ACL
|
||||||
|
if (prev_acl) {
|
||||||
|
if (acl_set_fd(fd, prev_acl) == -1) {
|
||||||
|
- message(MESS_ERROR, "setting ACL for %s: %s\n",
|
||||||
|
- log->files[logNum], strerror(errno));
|
||||||
|
- hasErrors = 1;
|
||||||
|
+ if (errno != ENOTSUP) {
|
||||||
|
+ message(MESS_ERROR, "setting ACL for %s: %s\n",
|
||||||
|
+ log->files[logNum], strerror(errno));
|
||||||
|
+ hasErrors = 1;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
acl_free(prev_acl);
|
||||||
|
prev_acl = NULL;
|
@ -1,12 +1,13 @@
|
|||||||
Summary: Rotates, compresses, removes and mails system log files
|
Summary: Rotates, compresses, removes and mails system log files
|
||||||
Name: logrotate
|
Name: logrotate
|
||||||
Version: 3.8.0
|
Version: 3.8.0
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
License: GPL+
|
License: GPL+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Url: https://fedorahosted.org/logrotate/
|
Url: https://fedorahosted.org/logrotate/
|
||||||
Source: https://fedorahosted.org/releases/l/o/logrotate/logrotate-%{version}.tar.gz
|
Source: https://fedorahosted.org/releases/l/o/logrotate/logrotate-%{version}.tar.gz
|
||||||
Patch0: logrotate-3.8.0-no-cron-redirection.patch
|
Patch0: logrotate-3.8.0-no-cron-redirection.patch
|
||||||
|
Patch1: logrotate-3.8.0-handle-acl-not-supported.patch
|
||||||
|
|
||||||
Requires: coreutils >= 5.92 libsepol libselinux popt libacl
|
Requires: coreutils >= 5.92 libsepol libselinux popt libacl
|
||||||
BuildRequires: libselinux-devel popt-devel libacl-devel
|
BuildRequires: libselinux-devel popt-devel libacl-devel
|
||||||
@ -27,6 +28,7 @@ log files on your system.
|
|||||||
%setup -q
|
%setup -q
|
||||||
|
|
||||||
%patch0 -p1
|
%patch0 -p1
|
||||||
|
%patch1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" WITH_SELINUX=yes WITH_ACL=yes
|
make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" WITH_SELINUX=yes WITH_ACL=yes
|
||||||
@ -57,6 +59,10 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status
|
%attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 01 2011 Jan Kaluza <jkaluza@redhat.com> 3.8.0-3
|
||||||
|
- fix #726980 - work properly when acl_get_fd is supported,
|
||||||
|
but acl_set_fd is not
|
||||||
|
|
||||||
* Wed Jul 20 2011 Jan Kaluza <jkaluza@redhat.com> 3.8.0-2
|
* Wed Jul 20 2011 Jan Kaluza <jkaluza@redhat.com> 3.8.0-2
|
||||||
- fix #722825 - do not redirect logrotate output in cron script
|
- fix #722825 - do not redirect logrotate output in cron script
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user