Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 162194 - "remove" script issue
Summary: "remove" script issue
Alias: None
Product: Fedora
Classification: Fedora
Component: logwatch
Version: 4
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2005-06-30 18:41 UTC by Piergiorgio Sartor
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-07-07 13:46:40 UTC

Attachments (Terms of Use)

Description Piergiorgio Sartor 2005-06-30 18:41:12 UTC
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 "" 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: --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 09:59:35 UTC
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 13:46:40 UTC
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.