Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 463208

Summary: app-antivirus/clamav init script incorrectly fixes log permissions
Product: Gentoo Linux Reporter: Richard Freeman <rich0>
Component: Current packagesAssignee: Antivirus Team <antivirus>
Status: RESOLVED FIXED    
Severity: normal CC: net-mail+disabled
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Richard Freeman gentoo-dev 2013-03-25 11:22:33 UTC
/etc/init.d/clamd logfix is used to fix log permissions after log rotation.

It references ${clamd_user} and ${freshclam_user}, but does not define these variables. 

The code to define them is in the start() function, which is not called during log rotation.  

The result is an error when freshclam is run from cron:
ERROR: Can't open /var/log/clamav/freshclam.log in append mode (check permissions!).
ERROR: Problem with internal logger (UpdateLogFile = /var/log/clamav/freshclam.log).

Setting these variables within logfix() has been tested and fixes the problem.
Comment 1 Eray Aslan gentoo-dev 2013-03-25 14:35:22 UTC
+*clamav-0.97.7-r1 (25 Mar 2013)
+
+  25 Mar 2013; Eray Aslan <eras@gentoo.org> +clamav-0.97.7-r1.ebuild,
+  +files/clamd.initd-r4:
+  Fix log file permissions - bug #463208
+
Comment 2 Tobias Klausmann (RETIRED) gentoo-dev 2013-04-01 08:28:53 UTC
This actually still broken. The logrotate calls logfix() directly, which means the user variables are never populated. checkpath defaults to root:root since the arg is empty. I propose moving the variables to the top of the file. That way, both start() and logfix() can use them when called independently.
Comment 3 Tobias Klausmann (RETIRED) gentoo-dev 2013-04-01 08:33:46 UTC
Ah, that doesn't work due to the custom get_config(). I suppose reverting start to the old local ... calls and adding them to logfix() is the Right Thing, but I'll let you decide.
Comment 4 Eray Aslan gentoo-dev 2013-04-01 12:52:27 UTC
Should be fixed in CVS.  Please let me know if you still have a problem.  Thanks.