1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- $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;
- }
|