summaryrefslogtreecommitdiff
path: root/package/logrotate/patches/patch-config_c
diff options
context:
space:
mode:
Diffstat (limited to 'package/logrotate/patches/patch-config_c')
-rw-r--r--package/logrotate/patches/patch-config_c59
1 files changed, 59 insertions, 0 deletions
diff --git a/package/logrotate/patches/patch-config_c b/package/logrotate/patches/patch-config_c
new file mode 100644
index 000000000..deea32c0f
--- /dev/null
+++ b/package/logrotate/patches/patch-config_c
@@ -0,0 +1,59 @@
+$Id$
+--- logrotate-3.7.1.orig/config.c Thu Aug 7 13:13:14 2003
++++ logrotate-3.7.1/config.c Sat Jan 20 18:54:35 2007
+@@ -142,12 +142,17 @@ static int checkFile(const char * fname)
+ (!fname[1] || (fname[1] == '.' && !fname[2])))
+ return 0;
+
++ /* Don't include 'hidden' files either; this breaks Gentoo
++ portage config file management http://bugs.gentoo.org/87683 */
++ if (fname[0] == '.')
++ return 0;
++
+ /* Check if fname is ending in a taboo-extension; if so, return
+ false */
+ for (i = 0; i < tabooCount; i++) {
+ if (!strcmp(fname + strlen(fname) - strlen(tabooExts[i]),
+ tabooExts[i])) {
+- message(MESS_ERROR, "Ignoring %s, because of %s "
++ message(MESS_DEBUG, "Ignoring %s, because of %s "
+ "ending\n", fname, tabooExts[i]);
+
+ return 0;
+@@ -511,6 +516,14 @@ static int readConfigFile(const char * c
+ newlog->flags &= ~LOG_FLAG_IFEMPTY;
+
+ *endtag = oldchar, start = endtag;
++ } else if (!strcmp(start, "dateext")) {
++ newlog->flags |= LOG_FLAG_DATEEXT;
++
++ *endtag = oldchar, start = endtag;
++ } else if (!strcmp(start, "nodateext")) {
++ newlog->flags &= ~LOG_FLAG_DATEEXT;
++
++ *endtag = oldchar, start = endtag;
+ } else if (!strcmp(start, "noolddir")) {
+ newlog->oldDir = NULL;
+
+@@ -667,6 +680,21 @@ static int readConfigFile(const char * c
+ message(MESS_ERROR, "%s:%d bad start count '%s'\n",
+ configFile, lineNum, start);
+ return 1;
++ }
++ *endtag = oldchar, start = endtag;
++ }
++ } else if (!strcmp(start, "maxage")) {
++ *endtag = oldchar, start = endtag;
++
++ if (!isolateValue(configFile, lineNum, "maxage count", &start,
++ &endtag)) {
++ oldchar = *endtag, *endtag = '\0';
++
++ newlog->rotateAge = strtoul(start, &chptr, 0);
++ if (*chptr || newlog->rotateAge < 0) {
++ message(MESS_ERROR, "%s:%d bad maximum age '%s'\n",
++ configFile, lineNum, start);
++ return 1;
+ }
+ *endtag = oldchar, start = endtag;
+ }