This commit is contained in:
Daniel Novotny 2009-12-17 14:26:55 +00:00
parent 859225c9f8
commit 9d4885c274
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,11 @@
--- logrotate-3.7.8/logrotate.c.readonly 2009-12-09 09:09:10.000000000 -0800
+++ logrotate-3.7.8/logrotate.c 2009-12-09 09:21:37.000000000 -0800
@@ -432,7 +432,7 @@ static int copyTruncate(char *currLog, c
message(MESS_DEBUG, "copying %s to %s\n", currLog, saveLog);
if (!debug) {
- if ((fdcurr = open(currLog, O_RDWR)) < 0) {
+ if ((fdcurr = open(currLog, (flags & LOG_FLAG_COPY) ? O_RDONLY : O_RDWR)) < 0) {
message(MESS_ERROR, "error opening %s: %s\n", currLog,
strerror(errno));
return 1;

View File

@ -1,7 +1,7 @@
Summary: Rotates, compresses, removes and mails system log files
Name: logrotate
Version: 3.7.8
Release: 5%{?dist}
Release: 6%{?dist}
License: GPL+
Group: System Environment/Base
Source: https://fedorahosted.org/releases/l/o/logrotate/logrotate-%{version}.tar.gz
@ -9,6 +9,7 @@ Patch1: logrotate-3.7.7-curdir2.patch
Patch2: logrotate-3.7.7-toolarge.patch
Patch3: logrotate-3.7.8-devnull.patch
Patch4: logrotate-3.7.8-man5.patch
Patch5: logrotate-3.7.8-readonly.patch
Requires: coreutils >= 5.92 libsepol libselinux popt
BuildRequires: libselinux-devel popt-devel
@ -31,6 +32,7 @@ log files on your system.
%patch2 -p1 -b .toolarge
%patch3 -p1 -b .devnull
%patch4 -p1 -b .man5
%patch5 -p1 -b .readonly
%build
make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" WITH_SELINUX=yes
@ -61,6 +63,9 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status
%changelog
* Wed Dec 09 2009 Henrique Martins <bugzilla-redhat-2009@martins.cc> 3.7.8-6
- fix #545919 (rotate non-writable files when copy is set)
* Tue Sep 29 2009 Daniel Novotny <dnovotny@redhat.com> 3.7.8-5
- fix #525659 (man page for logrotate.conf)