[logrotate/f15] fix #719331 - fixed age directive parsing
Jan Kaluža
jkaluza at fedoraproject.org
Mon Jul 11 13:47:04 UTC 2011
commit 0ee99192e9399a4c4f69cef625bd85e0af7898aa
Author: Jan Kaluza <hanzz.k at gmail.com>
Date: Mon Jul 11 15:46:09 2011 +0200
fix #719331 - fixed age directive parsing
logrotate-3.7.9-fix-age-parsing.patch | 65 +++++++++++++++++++++++++++++++++
logrotate.spec | 7 +++-
2 files changed, 71 insertions(+), 1 deletions(-)
---
diff --git a/logrotate-3.7.9-fix-age-parsing.patch b/logrotate-3.7.9-fix-age-parsing.patch
new file mode 100644
index 0000000..1523505
--- /dev/null
+++ b/logrotate-3.7.9-fix-age-parsing.patch
@@ -0,0 +1,65 @@
+diff --git a/config.c b/config.c
+index 8eb2ae2..0ca92b1 100644
+--- a/config.c
++++ b/config.c
+@@ -874,7 +874,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ (configFile, lineNum, "start count", &start,
+ &buf, length)) != NULL) {
+
+- newlog->logStart = strtoul(start, &chptr, 0);
++ newlog->logStart = strtoul(key, &chptr, 0);
+ if (*chptr || newlog->logStart < 0) {
+ message(MESS_ERROR, "%s:%d bad start count '%s'\n",
+ configFile, lineNum, key);
+@@ -892,7 +892,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ if ((key = isolateValue
+ (configFile, lineNum, "maxage count", &start,
+ &buf, length)) != NULL) {
+- newlog->rotateAge = strtoul(start, &chptr, 0);
++ newlog->rotateAge = strtoul(key, &chptr, 0);
+ if (*chptr || newlog->rotateAge < 0) {
+ message(MESS_ERROR, "%s:%d bad maximum age '%s'\n",
+ configFile, lineNum, start);
+@@ -1022,7 +1022,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ goto error;
+ }
+ }
+- else continue;
++
+ #if 0
+ if (stat(newlog->oldDir, &sb)) {
+ message(MESS_ERROR, "%s:%d error verifying olddir "
+@@ -1067,7 +1067,6 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ goto error;
+ }
+ }
+- else continue;
+
+ if (access(newlog->compress_prog, X_OK)) {
+ message(MESS_ERROR,
+@@ -1098,7 +1097,6 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ goto error;
+ }
+ }
+- else continue;
+
+ if (access(newlog->uncompress_prog, X_OK)) {
+ message(MESS_ERROR,
+@@ -1134,7 +1132,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ } else {
+ goto error;
+ }
+- } else continue;
++ }
+
+ if (poptParseArgvString(options,
+ &newlog->compress_options_count,
+@@ -1167,7 +1165,7 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ } else {
+ goto error;
+ }
+- } else continue;
++ }
+
+ message(MESS_DEBUG, "compress_ext is now %s\n",
+ newlog->compress_ext);
diff --git a/logrotate.spec b/logrotate.spec
index a624c02..6b72f49 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: 11%{?dist}
+Release: 12%{?dist}
License: GPL+
Group: System Environment/Base
Url: https://fedorahosted.org/logrotate/
@@ -17,6 +17,7 @@ Patch8: logrotate-3.7.9-statefile.patch
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
Requires: coreutils >= 5.92 libsepol libselinux popt libacl
BuildRequires: libselinux-devel popt-devel libacl-devel
@@ -46,6 +47,7 @@ log files on your system.
%patch9 -p1
%patch10
%patch11
+%patch12 -p1
%build
make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS" WITH_SELINUX=yes WITH_ACL=yes
@@ -76,6 +78,9 @@ rm -rf $RPM_BUILD_ROOT
%attr(0644, root, root) %verify(not size md5 mtime) %config(noreplace) %{_localstatedir}/lib/logrotate.status
%changelog
+* Mon Jul 11 2011 Jan Kaluza <jkaluza at redhat.com> 3.7.9-12
+- fix #719331 - fixed age directive parsing
+
* Tue May 31 2011 Jan Kaluza <jkaluza at redhat.com> 3.7.9-11
- fix #709034 - work properly when ACLs are not supported
More information about the scm-commits
mailing list