Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 463208 - app-antivirus/clamav init script incorrectly fixes log permissions
Summary: app-antivirus/clamav init script incorrectly fixes log permissions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Antivirus Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-25 11:22 UTC by Richard Freeman
Modified: 2013-04-01 12:52 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.