summaryrefslogtreecommitdiff
path: root/package/logrotate/patches/patch-config_c
blob: deea32c0fbadc515623acb54bbb06f6eb05d7d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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;
 		}