[logrotate/f15] fix #723547 - fixed size directive parsing fix #722825 - do not redirect logrotate output in cron sc

Jan Kaluža jkaluza at fedoraproject.org
Fri Jul 22 06:57:07 UTC 2011


commit 220c22097f5dab4903d63889e7b9d66629dfbd9e
Author: HanzZ <hanzz.k at gmail.com>
Date:   Fri Jul 22 11:00:01 2011 +0200

    fix #723547 - fixed size directive parsing
    fix #722825 - do not redirect logrotate output in cron script

 logrotate-3.8.0-no-cron-redirection.patch |   11 +++++++
 logrotate-3.8.0-rot-size.patch            |   44 +++++++++++++++++++++++++++++
 logrotate.spec                            |   10 ++++++-
 3 files changed, 64 insertions(+), 1 deletions(-)
---
diff --git a/logrotate-3.8.0-no-cron-redirection.patch b/logrotate-3.8.0-no-cron-redirection.patch
new file mode 100644
index 0000000..eae80a6
--- /dev/null
+++ b/logrotate-3.8.0-no-cron-redirection.patch
@@ -0,0 +1,11 @@
+Index: /trunk/examples/logrotate.cron
+===================================================================
+--- a/examples/logrotate.cron (revision 268)
++++ b/examples/logrotate.cron (revision 334)
+@@ -1,5 +1,5 @@
+ #!/bin/sh
+ 
+-/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1
++/usr/sbin/logrotate /etc/logrotate.conf
+ EXITVALUE=$?
+ if [ $EXITVALUE != 0 ]; then
diff --git a/logrotate-3.8.0-rot-size.patch b/logrotate-3.8.0-rot-size.patch
new file mode 100644
index 0000000..08b78ba
--- /dev/null
+++ b/logrotate-3.8.0-rot-size.patch
@@ -0,0 +1,44 @@
+Index: trunk/config.c
+===================================================================
+--- trunk/config.c	(revision 334)
++++ trunk/config.c	(working copy)
+@@ -891,7 +891,6 @@
+ 							
+ 					if ((key = isolateValue(configFile, lineNum, opt, &start,
+ 							&buf, length)) != NULL) {
+-						free(opt);
+ 						int l = strlen(key) - 1;
+ 						if (key[l] == 'k') {
+ 							key[l] = '\0';
+@@ -903,6 +902,7 @@
+ 							key[l] = '\0';
+ 							multiplier = 1024 * 1024 * 1024;
+ 						} else if (!isdigit(key[l])) {
++							free(opt);
+ 							message(MESS_ERROR, "%s:%d unknown unit '%c'\n",
+ 								configFile, lineNum, key[l]);
+ 							if (newlog != defConfig) {
+@@ -919,6 +919,7 @@
+ 						if (*chptr) {
+ 							message(MESS_ERROR, "%s:%d bad size '%s'\n",
+ 								configFile, lineNum, key);
++							free(opt);
+ 							if (newlog != defConfig) {
+ 								state = STATE_ERROR;
+ 								continue;
+@@ -926,11 +927,13 @@
+ 								goto error;
+ 							}
+ 						}
+-						if (!strncmp(key, "size", 4)) {
++						if (!strncmp(opt, "size", 4)) {
+ 						  newlog->criterium = ROT_SIZE;
+ 						  newlog->threshhold = size;
+-						} else
++						} else {
+ 						  newlog->minsize = size;
++						}
++						free(opt);
+ 					}
+ 					else {
+ 						free(opt);
diff --git a/logrotate.spec b/logrotate.spec
index 6b72f49..6b59e8a 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.9
-Release: 12%{?dist}
+Release: 13%{?dist}
 License: GPL+
 Group: System Environment/Base
 Url: https://fedorahosted.org/logrotate/
@@ -18,6 +18,8 @@ Patch9: logrotate-3.7.9-atomic-create.patch
 Patch10: logrotate-3.7.9-address-parsing.patch
 Patch11: logrotate-3.7.9-support-no-acls.patch
 Patch12: logrotate-3.7.9-fix-age-parsing.patch
+Patch13: logrotate-3.8.0-no-cron-redirection.patch
+Patch14: logrotate-3.8.0-rot-size.patch
 
 Requires: coreutils >= 5.92 libsepol libselinux popt libacl
 BuildRequires: libselinux-devel popt-devel libacl-devel
@@ -48,6 +50,8 @@ log files on your system.
 %patch10
 %patch11
 %patch12 -p1
+%patch13 -p1
+%patch14 -p1
 
 %build
 make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" WITH_SELINUX=yes WITH_ACL=yes
@@ -78,6 +82,10 @@ rm -rf $RPM_BUILD_ROOT
 %attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status
 
 %changelog
+* Fri Jul 22 2011 Jan Kaluza <jkaluza at redhat.com> 3.7.9-13
+- fix #723547 - fixed size directive parsing
+- fix #722825 - do not redirect logrotate output in cron script
+
 * Mon Jul 11 2011 Jan Kaluza <jkaluza at redhat.com> 3.7.9-12
 - fix #719331 - fixed age directive parsing
 


More information about the scm-commits mailing list