Bug 162194 - "remove" script issue
"remove" script issue
Product: Fedora
Classification: Fedora
Component: logwatch (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ivana Varekova
Depends On:
  Show dependency treegraph
Reported: 2005-06-30 14:41 EDT by Piergiorgio Sartor
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-07-07 09:46:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Piergiorgio Sartor 2005-06-30 14:41:12 EDT
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):


How reproducible:

Just call the script as above.

Steps to Reproduce:
Actual results:

Error from egrep

Expected results:

Some output, maybe

Additional info:

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
/etc/log.d/scripts/services/kernel) 2>&1

in which it is clearly visible how "remove" is called and the
related issue (at least on my installation).
Comment 1 Eduard Kohler 2005-07-06 05:59:35 EDT
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\"");
Comment 2 Ivana Varekova 2005-07-07 09:46:40 EDT
Thank you for your notices.
This bug is fixed in the last logwatch version (logwatch-6.1.2-2).

Note You need to log in before you can comment on or make changes to this bug.