[Bug 799623] Re: Incorrect generated logrotate file
Louis Bouchard
louis.bouchard at canonical.com
Tue Feb 11 11:07:07 UTC 2014
debdiff for Precise
** Description changed:
+ SRU justification :
+
+ Without this fix, installation scripts can generate invalid configuration files
+ (i.e. logrotate.d/clamav-damemon)
+
+ Impact :
+
+ Invalid configuration files
+
+ Fix :
+
+ Make the parsing algorithm a bit more discriminative
+
+ Test Case :
+
+ 1) install clamav & clamav-daemon
+ $ sudo apt-get -y install clamav clamav-daemon
+
+ 2) Add the following line before the first LogFile statement
+ LogFileMaxSize 0
+
+ 3) Deinstall without purging the config file
+ apt-get -y remove clamav clamav-daemon clamav-base clamav-freshclam libclamav6
+
+ 4) Re-install clamav & clamav-daemon & keep the existing config file
+ apt-get -y install clamav clamav-daemon clamav-base clamav-freshclam libclamav6
+
+ The clamav-daemon file should look like this (which is wrong) :
+ 0 {
+ rotate 12
+ weekly
+ compress
+ delaycompress
+ create 640 clamav adm
+ postrotate
+ /etc/init.d/clamav-daemon reload-log > /dev/null
+ endscript
+ }
+
+ The correct format of the file should be :
+ /var/log/clamav/clamav.log {
+ rotate 12
+ weekly
+ compress
+ delaycompress
+ create 640 clamav adm
+ postrotate
+ /etc/init.d/clamav-daemon reload-log > /dev/null
+ endscript
+ }
+
+ Regression :
+
+ None expected, the values returned are still valid.
+
+ Original description of the problem :
Binary package hint: clamav-daemon
Version: 0.96.5+dfsg-1ubuntu1.10.04.2
Sometimes the logrotate conf file (/etc/logrotate.d/clamav-daemon) is
incorrectly generated, with a '0' instead of
'/var/log/clamav/clamav.log'. See the attached file for a example of bad
configuration.
I suspect the root cause is in the clamav-daemon.postinst script. In the
'configure' case the logrotate conf file could be generated and I feel
the variable 'LogFile' is with a bad value thus printing like "0" in
the conf file.
Cheers,
Javier
** Patch added: "lp799623_fix_logrotate_precise.debdiff"
https://bugs.launchpad.net/ubuntu/+source/clamav/+bug/799623/+attachment/3977076/+files/lp799623_fix_logrotate_precise.debdiff
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to clamav in Ubuntu.
https://bugs.launchpad.net/bugs/799623
Title:
Incorrect generated logrotate file
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/clamav/+bug/799623/+subscriptions
More information about the Ubuntu-server-bugs
mailing list