Red Hat Bugzilla – Bug 162194
"remove" script issue
Last modified: 2007-11-30 17:11:09 EST
Description of problem:
The perl script "/etc/log.d/scripts/shared/remove", which is a simple
single line as follows:
system("/bin/egrep -vi @ARGV");
attemps to run "egrep" without taking care of quotes around the
argument, so if it is composed of more than one word, an error is
returned as: "egrep: xyz: no such file or directory", where "xyz"
is the second argument.
The problem is that this script is called, from "logwatch.pl" as:
perl /etc/log.d/scripts/shared/remove 'locate module'
but the quotes around the argument are filtered and "egrep" is
called, in effect, with two arguments, reporting the error above.
Version-Release number of selected component (if applicable):
Just call the script as above.
Steps to Reproduce:
Error from egrep
Some output, maybe
The logwatch script fails for the "kernel" service,
The output of:
logwatch.pl --debug=8 --service kernel --print
among all, will print:
Processing Service: kernel
( /bin/cat /tmp/logwatch.R2ZRWtCb/messages | /usr/bin/perl
/etc/log.d/scripts/shared/onlyservice 'kernel' |/usr/bin/perl
/etc/log.d/scripts/shared/removeheaders '' |/usr/bin/perl
/etc/log.d/scripts/shared/remove 'segfault' |/usr/bin/perl
/etc/log.d/scripts/shared/remove 'locate module' |/usr/bin/perl
in which it is clearly visible how "remove" is called and the
related issue (at least on my installation).
Same problem with the 'kernel' report.
Solved by modifing a line in the '/etc/log.d/scripts/shared/remove' script:
system("/bin/egrep -vi \"@ARGV\"");
Thank you for your notices.
This bug is fixed in the last logwatch version (logwatch-6.1.2-2).