Debian Bug report logs - #652838
unzip: zipgrep parses long egrep options as short options

version graph

Package: unzip; Maintainer for unzip is Santiago Vila <sanvila@debian.org>; Source for unzip is src:unzip.

Reported by: Axel Beckert <abe@debian.org>

Date: Tue, 20 Dec 2011 21:06:02 UTC

Severity: normal

Tags: upstream

Found in version unzip/6.0-4

Forwarded to http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=384

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, abe@debian.org, Santiago Vila <sanvila@debian.org>:
Bug#652838; Package unzip. (Tue, 20 Dec 2011 21:06:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Axel Beckert <abe@debian.org>:
New Bug report received and forwarded. Copy sent to abe@debian.org, Santiago Vila <sanvila@debian.org>. (Tue, 20 Dec 2011 21:06:07 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Axel Beckert <abe@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: unzip: zipgrep parses long egrep options as short options
Date: Tue, 20 Dec 2011 22:04:11 +0100
Package: unzip
Version: 6.0-4
Severity: normal
File: /usr/bin/zipgrep

From the zipgrep man page:

       zipgrep [egrep_options] pattern file[.zip] [file(s) ...]  [-x xfile(s) ...]

       [...]

       zipgrep is a shell script and requires egrep(1) and unzip(1) to
       function.  Its output is identical to that of egrep(1).

But the following shell code from zipgrep mistreats long options like
--color or --line-buffered (both have no equivalent short option) as
short options (or similar):

opt=`echo "$opt" | sed -e 's/ //g' -e 's/-//g'`
case "$opt" in
  *l*) list=1; opt=`echo $opt | sed s/l//`
esac
case "$opt" in
  *h*) silent=1
esac
if test -n "$opt"; then
  opt="-$opt"
fi

Examples:

$ zipgrep Axel blafasel.zip
scratch/debian/mp4h/CREDITS:      Axel Beckert ................ <rse-wml@deuxchevaux.org>
scratch/debian/mp4h/debian/control:Uploaders: Axel Beckert <abe@debian.org>
[...]
$ zipgrep --color Axel blafasel.zip
scratch/debian/mp4h/CREDITS
scratch/debian/mp4h/debian/control
[...]
$ zipgrep --color=always Axel blafasel.zip
egrep: invalid option -- '='
Usage: egrep [OPTION]... PATTERN [FILE]...
Try `egrep --help' for more information.

In the second example, the "l" in "--color" is passed as "-l" to egrep,
hence it suppresses the matches itself (and hence -o and -c are of no
effect).

In the third example "=" is passed as "-=" or so which causes egrep to
bail out due to an unknown option.

-- System Information:
Debian Release: 6.0.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages unzip depends on:
ii  libbz2-1.0                    1.0.5-6    high-quality block-sorting file co
ii  libc6                         2.11.2-10  Embedded GNU C Library: Shared lib

unzip recommends no packages.

Versions of packages unzip suggests:
ii  zip                           3.0-3      Archiver for .zip files

-- no debconf information




Added tag(s) upstream. Request was from Santiago Vila <sanvila@unex.es> to control@bugs.debian.org. (Sun, 04 Mar 2012 15:45:19 GMT) Full text and rfc822 format available.

Set Bug forwarded-to-address to 'http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=285'. Request was from Santiago Vila <sanvila@unex.es> to control@bugs.debian.org. (Sun, 04 Mar 2012 15:45:24 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#652838; Package unzip. (Sun, 04 Mar 2012 15:51:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Santiago Vila <sanvila@unex.es>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@debian.org>. (Sun, 04 Mar 2012 15:51:06 GMT) Full text and rfc822 format available.

Message #14 received at 652838@bugs.debian.org (full text, mbox):

From: Santiago Vila <sanvila@unex.es>
To: Axel Beckert <abe@debian.org>, 652838@bugs.debian.org
Subject: Re: Bug#652838: unzip: zipgrep parses long egrep options as short options
Date: Sun, 4 Mar 2012 16:42:47 +0100 (CET)
Thanks for the report. I've just forwarded it upstream:

http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=285




Information forwarded to debian-bugs-dist@lists.debian.org, Santiago Vila <sanvila@debian.org>:
Bug#652838; Package unzip. (Sun, 04 Mar 2012 16:15:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Santiago Vila <sanvila@unex.es>:
Extra info received and forwarded to list. Copy sent to Santiago Vila <sanvila@debian.org>. (Sun, 04 Mar 2012 16:15:05 GMT) Full text and rfc822 format available.

Message #19 received at 652838@bugs.debian.org (full text, mbox):

From: Santiago Vila <sanvila@unex.es>
To: Axel Beckert <abe@debian.org>, 652838@bugs.debian.org
Subject: Re: Bug#652838: unzip: zipgrep parses long egrep options as short options
Date: Sun, 4 Mar 2012 17:12:29 +0100 (CET)
Sorry, this is the right URL:

http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=384




Changed Bug forwarded-to-address to 'http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=384' from 'http://www.info-zip.org/phpBB3/viewtopic.php?f=7&t=285' Request was from Santiago Vila <sanvila@unex.es> to control@bugs.debian.org. (Sun, 04 Mar 2012 16:15:13 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 21:37:51 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.