Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-03-22 Thread Weerasak Chongnguluam
Hello from Thailand Mini-DebCamp 2010 BSP. Could you try the following patch? I skip all block of shell script prerotate,postrotate,firstrotate, and lastrotate --- logrotate-3.7.8.orig/config.c +++ logrotate-3.7.8/config.c @@ -569,7 +569,23 @@ message(MESS_ERROR, %s:%d } expected \n,

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-03-16 Thread Weerasak Chongnguluam
Hi Paul, from your patch parse571033.patch if *start == '\n' and (isblank(*start) (*start)) never is true start dosen't incresed, cause infinite loop. Because isblank check only a space or a tab.

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-03-16 Thread Paul Martin
On Tue, Mar 16, 2010 at 02:29:26PM +0700, Weerasak Chongnguluam wrote: from your patch parse571033.patch if *start == '\n' and (isblank(*start) (*start)) never is true start dosen't incresed, cause infinite loop. Because isblank check only a space or a tab. Puts on Brown Paper Bag. Fixed

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-03-15 Thread Weerasak Chongnguluam
Hello from Thailand Mini-DebCamp 2010 BSP. Could you try the following patch? I skip all block of shell script prerotate,postrotate,firstrotate, and lastrotate. --- logrotate-3.7.8.orig/config.c +++ logrotate-3.7.8/config.c @@ -569,7 +569,23 @@ message(MESS_ERROR, %s:%d } expected \n,

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-03-15 Thread Paul Martin
On Mon, Mar 15, 2010 at 03:00:11PM +0700, Weerasak Chongnguluam wrote: Hello from Thailand Mini-DebCamp 2010 BSP. Could you try the following patch? I skip all block of shell script prerotate,postrotate,firstrotate, and lastrotate. It's as easy to confuse this one, too. eg. file {

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-03-15 Thread Paul Martin
Here's my patch, based on your idea. -- Paul Martin p...@debian.org Index: logrotate-3.7.8/config.c === --- logrotate-3.7.8.orig/config.c 2010-03-15 15:52:12.146006930 + +++ logrotate-3.7.8/config.c 2010-03-15 15:49:24.748007001

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-03-15 Thread Paul Martin
Oops! Missing }. -- Paul Martin p...@debian.org Index: logrotate-3.7.8/config.c === --- logrotate-3.7.8.orig/config.c 2010-03-15 16:01:15.030006637 + +++ logrotate-3.7.8/config.c 2010-03-15 16:01:45.701009309 + @@ -575,8

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-02-23 Thread Stefan Fritsch
Hi Paul, On Tuesday 23 February 2010, Paul Martin wrote: Could you try the following patch? it fixes the problem with this particular config but I don't really like it. It does not change the fact that the config parsing is extremely fragile. If a postrotate script contains an unbalanced

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-02-22 Thread Paul Martin
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

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-02-22 Thread Paul Martin
The standard apache2 logrotate conf has: postrotate if [ -f `. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}` ]; then /etc/init.d/apache2 reload /dev/null fi endscript The trailing } is likely to

Bug#571033: logrotate: Logrotate mis-parses config if log dir does not exist, and rotates wrong files

2010-02-22 Thread Paul Martin
On Mon, Feb 22, 2010 at 11:24:53PM +0100, Stefan Fritsch wrote: If the directory of a log file specification with wild cards does not exist, logrotate may mis-parse the config file so badly that it will rotate arbitrary files appearing in the postrotate script. reading config file apache2