1
0

patch-config_c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. $Id$
  2. --- logrotate-3.7.1.orig/config.c Thu Aug 7 13:13:14 2003
  3. +++ logrotate-3.7.1/config.c Sat Jan 20 18:54:35 2007
  4. @@ -142,12 +142,17 @@ static int checkFile(const char * fname)
  5. (!fname[1] || (fname[1] == '.' && !fname[2])))
  6. return 0;
  7. + /* Don't include 'hidden' files either; this breaks Gentoo
  8. + portage config file management http://bugs.gentoo.org/87683 */
  9. + if (fname[0] == '.')
  10. + return 0;
  11. +
  12. /* Check if fname is ending in a taboo-extension; if so, return
  13. false */
  14. for (i = 0; i < tabooCount; i++) {
  15. if (!strcmp(fname + strlen(fname) - strlen(tabooExts[i]),
  16. tabooExts[i])) {
  17. - message(MESS_ERROR, "Ignoring %s, because of %s "
  18. + message(MESS_DEBUG, "Ignoring %s, because of %s "
  19. "ending\n", fname, tabooExts[i]);
  20. return 0;
  21. @@ -511,6 +516,14 @@ static int readConfigFile(const char * c
  22. newlog->flags &= ~LOG_FLAG_IFEMPTY;
  23. *endtag = oldchar, start = endtag;
  24. + } else if (!strcmp(start, "dateext")) {
  25. + newlog->flags |= LOG_FLAG_DATEEXT;
  26. +
  27. + *endtag = oldchar, start = endtag;
  28. + } else if (!strcmp(start, "nodateext")) {
  29. + newlog->flags &= ~LOG_FLAG_DATEEXT;
  30. +
  31. + *endtag = oldchar, start = endtag;
  32. } else if (!strcmp(start, "noolddir")) {
  33. newlog->oldDir = NULL;
  34. @@ -667,6 +680,21 @@ static int readConfigFile(const char * c
  35. message(MESS_ERROR, "%s:%d bad start count '%s'\n",
  36. configFile, lineNum, start);
  37. return 1;
  38. + }
  39. + *endtag = oldchar, start = endtag;
  40. + }
  41. + } else if (!strcmp(start, "maxage")) {
  42. + *endtag = oldchar, start = endtag;
  43. +
  44. + if (!isolateValue(configFile, lineNum, "maxage count", &start,
  45. + &endtag)) {
  46. + oldchar = *endtag, *endtag = '\0';
  47. +
  48. + newlog->rotateAge = strtoul(start, &chptr, 0);
  49. + if (*chptr || newlog->rotateAge < 0) {
  50. + message(MESS_ERROR, "%s:%d bad maximum age '%s'\n",
  51. + configFile, lineNum, start);
  52. + return 1;
  53. }
  54. *endtag = oldchar, start = endtag;
  55. }