From f307856de3544302078296399bfd843da36232ee Mon Sep 17 00:00:00 2001 From: HanzZ Date: Fri, 22 Jul 2011 10:24:18 +0200 Subject: [PATCH 1/2] fix #723547 - fixed size directive parsing --- logrotate.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/logrotate.spec b/logrotate.spec index 0718467..75d6d20 100644 --- a/logrotate.spec +++ b/logrotate.spec @@ -1,12 +1,13 @@ Summary: Rotates, compresses, removes and mails system log files Name: logrotate Version: 3.8.0 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL+ Group: System Environment/Base Url: https://fedorahosted.org/logrotate/ Source: https://fedorahosted.org/releases/l/o/logrotate/logrotate-%{version}.tar.gz Patch0: logrotate-3.8.0-no-cron-redirection.patch +Patch1: logrotate-3.8.0-rot-size.patch Requires: coreutils >= 5.92 libsepol libselinux popt libacl BuildRequires: libselinux-devel popt-devel libacl-devel @@ -27,6 +28,7 @@ log files on your system. %setup -q %patch0 -p1 +%patch1 -p1 %build make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" WITH_SELINUX=yes WITH_ACL=yes @@ -57,6 +59,9 @@ 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 3.8.0-3 +- fix #723547 - fixed size directive parsing + * Wed Jul 20 2011 Jan Kaluza 3.8.0-2 - fix #722825 - do not redirect logrotate output in cron script From e93251a9b63790b649761478fde8038adca557d0 Mon Sep 17 00:00:00 2001 From: HanzZ Date: Fri, 22 Jul 2011 10:24:35 +0200 Subject: [PATCH 2/2] fix #723547 - fixed size directive parsing --- logrotate-3.8.0-rot-size.patch | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 logrotate-3.8.0-rot-size.patch 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);