On Mon, Feb 22, 2010 at 11:47:24PM +0100, Stefan Fritsch wrote:
> On Monday 22 February 2010, you wrote:
>
> > Please could you tell us what your /etc/logrotate.d/apache2
> > contains.
>
> I guess the problem is that the postrotate script contains a '}':
That was my guess.
Could you try the following patch?
--
Paul Martin <[email protected]>
Index: logrotate-3.7.8/config.c
===================================================================
--- logrotate-3.7.8.orig/config.c 2010-02-22 22:56:04.140009863 +0000
+++ logrotate-3.7.8/config.c 2010-02-22 23:06:08.705006746 +0000
@@ -501,6 +501,7 @@
const char **argv;
int argc, argNum;
int logerror = 0;
+ int bracketdepth = 0;
struct logInfo *log;
static unsigned recursion_depth = 0U;
@@ -568,13 +569,17 @@
message(MESS_ERROR, "found error in %s, skipping\n",
newlog->pattern ? newlog->pattern : "log config");
- while (*start != '}') {
+ while (*start != '}' || bracketdepth) {
if (*start == 0) {
message(MESS_ERROR, "%s:%d } expected \n",
configFile, lineNum);
return 1;
} else if (*start == '\n') {
lineNum++;
+ } else if (*start == '}') {
+ bracketdepth--;
+ } else if (*start == '{') {
+ bracketdepth++;
}
start++;
}
@@ -1347,6 +1352,7 @@
return 1;
}
+ bracketdepth = 0;
newlog->files = NULL;
newlog->numFiles = 0;
for (argNum = 0; argNum < argc && logerror != 1; argNum++) {