Bug 3501 - grep-2.10-1.mga2 ignores -q
Summary: grep-2.10-1.mga2 ignores -q
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: Normal major
Target Milestone: ---
Assignee: Nicolas Vigier
QA Contact:
URL:
Whiteboard:
Keywords: Triaged, UPSTREAM
Depends on:
Blocks:
 
Reported: 2011-11-27 18:49 CET by J H Wilson
Modified: 2012-06-17 15:20 CEST (History)
1 user (show)

See Also:
Source RPM: grep
CVE:
Status comment:


Attachments

Description J H Wilson 2011-11-27 18:49:20 CET
grep 2.10 ignores -q when it thinks the output file is one of its input files.
it gives error output: "grep: input file ... is also the output" and fails.
this breaks all scripts which depend on -q option behaving appropriately.
according to the man page, and previously, '-q' option is supposed to ignore errors and return 0 if the input is matched.  this option means there should be no output, so checking the output file is inappropriate when -q is given.
the NEWS for this release indicates 'grep now rejects a command like "grep -r pattern . > out", in which the output file is also one of the inputs, because it can result in an "infinite" disk-filling loop. [bug present since "the beginning"]'; so it is undoubtedly their bug.
Comment 1 Manuel Hiebel 2011-11-27 22:14:47 CET
Hi, thanks for reporting this bug.
Assigned to the package maintainer.

Keywords: (none) => Triaged
Assignee: bugsquad => boklm
Source RPM: (none) => grep

Comment 2 Nicolas Vigier 2011-11-28 01:46:22 CET
I opened a bug upstream :
https://savannah.gnu.org/bugs/?34917
Comment 3 Nicolas Vigier 2012-03-01 01:10:45 CET
This is now fixed upstream :
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=979592944f06bddb108458073239d2ff52d2c475
Comment 4 Marja Van Waes 2012-05-26 13:07:48 CEST
Hi,

This bug was filed against cauldron, but we do not have cauldron at the moment.

Please report whether this bug is still valid for Mageia 2.

Thanks :)

Cheers,
marja

Keywords: (none) => NEEDINFO

Comment 5 Yuri Chornoivan 2012-06-17 12:49:22 CEST
Works fine here with grep-2.11-2.mga2

Testcase:

grep -q a test > test

returns nothing.

CC: (none) => yurchor

Comment 6 Manuel Hiebel 2012-06-17 15:20:14 CEST
closing then

Keywords: NEEDINFO => UPSTREAM
Status: NEW => RESOLVED
Resolution: (none) => FIXED


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