diff --git a/logrotate-3.7.8-readonly.patch b/logrotate-3.7.8-readonly.patch new file mode 100644 index 0000000..afa60c2 --- /dev/null +++ b/logrotate-3.7.8-readonly.patch @@ -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; diff --git a/logrotate.spec b/logrotate.spec index 79f9650..1b0a11d 100644 --- a/logrotate.spec +++ b/logrotate.spec @@ -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 3.7.8-6 +- fix #545919 (rotate non-writable files when copy is set) + * Tue Sep 29 2009 Daniel Novotny 3.7.8-5 - fix #525659 (man page for logrotate.conf)