Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107362 - clamav: /etc/init.d/clamd does not parse configuration file properly
Summary: clamav: /etc/init.d/clamd does not parse configuration file properly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Antivirus Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-26 23:31 UTC by Georgi Georgiev
Modified: 2005-09-29 04:56 UTC (History)
0 users

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 Georgi Georgiev 2005-09-26 23:31:38 UTC
This is current as of clamav-0.87. The init.d script installed by clamav does
some grepping on the configuration file, but at least one in particular
misbehaves. I am referring to the following:

	local logfile=`grep -e "^LogFile" /etc/clamd.conf | cut -d\  -f 2`
	local clamav_user=`grep -e "^User" /etc/clamd.conf | cut -d\  -f 2`

Here is what the first one produces on my configuration file:

chutz@tiger ~ $ grep -e "^LogFile" /etc/clamd.conf | cut -d\  -f 2
/var/log/clamav/clamd.log
0

And as to why:

chutz@tiger ~ $ grep -e "^LogFile" /etc/clamd.conf
LogFile /var/log/clamav/clamd.log
LogFileMaxSize 0

Now, you could fix the grep to have a [[:space:]], or you could transform those
"grep | cut"-s into a much more readable and flexible awk:

awk '$1 == "LogFile" { print $2 }'

Also mind that the current grep | cut method would fail if the configuration
file uses <tab> instead of spaces, or multiple spaces, you name it.
Comment 1 Andrej Kacian (RETIRED) gentoo-dev 2005-09-27 07:28:54 UTC
You're right, we're not using ideal system. I'll change this to use awk later
today, when I'll get back to my development box.
Comment 2 Andrej Kacian (RETIRED) gentoo-dev 2005-09-29 04:56:22 UTC
I have changed the initscript in portage, but didn't bump the ebuild, as it's
unchanged.

Thanks for pointing this out,Georgi.