Your message dated Tue, 11 Mar 2025 16:26:54 +0000
with message-id <[email protected]>
and subject line Bug#1054628: fixed in unzip 6.0-29
has caused the Debian Bug report #1054628,
regarding unzip: zipgrep doesn't handle regexp with some special characters 
correctly
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1054628: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054628
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: unzip
Version: 6.0-28
Severity: normal
Tags: upstream patch

zipgrep doesn't handle regexp with some special characters correctly,
as shown below.

$ echo a.b > file1
$ echo a-b > file2
$ zip files.zip file1 file2
  adding: file1 (stored 0%)
  adding: file2 (stored 0%)

With egrep:

$ egrep a\\.b file1 file2
file1:a.b
$ egrep a\|b file1 file2
file1:a.b
file2:a-b
$

But with zipgrep:

$ zipgrep a\\.b files.zip
$ zipgrep a\|b files.zip
$

This is due to the following code:

# Escape shell-special characters in "pat".
pat=` echo "$pat" | \
 sed -e 's/\\\\/\\\\\\\\/g' -e 's/|/\\\|/g' -e 's/&/\\\&/g' `

which breaks the regexp. Escaping is useless because once a string
is in a shell variable pat, it is no longer reinterpreted when just
using "$pat". And as a consequence, escaping is incorrect because
the escape characters are not removed when using "$pat". Moreover,
the use of echo was not portable.

I've attached a patch, which removes this useless/incorrect code.

-- System Information:
Debian Release: trixie/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 
'stable-security'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
merged-usr: no
Architecture: amd64 (x86_64)

Kernel: Linux 6.5.0-3-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages unzip depends on:
ii  libbz2-1.0  1.0.8-5+b1
ii  libc6       2.37-12

unzip recommends no packages.

Versions of packages unzip suggests:
ii  zip  3.0-13

-- no debconf information

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Index: b/unix/zipgrep
===================================================================
--- a/unix/zipgrep
+++ b/unix/zipgrep
@@ -49,10 +49,6 @@ status_grep_global=1
 IFS='
 '
 
-# Escape shell-special characters in "pat".
-pat=` echo "$pat" | \
- sed -e 's/\\\\/\\\\\\\\/g' -e 's/|/\\\|/g' -e 's/&/\\\&/g' `
-
 # Use "unzip -Z1" to get a listing of the specified members from the
 # specified archive.  Escape any backslashes in a file name.
 for i in `unzip -Z1 "$zipfile" ${1+"$@"} | sed -e 's/\\\\/\\\\\\\\/g' `; do

--- End Message ---
--- Begin Message ---
Source: unzip
Source-Version: 6.0-29
Done: Santiago Vila <[email protected]>

We believe that the bug you reported is fixed in the latest version of
unzip, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Santiago Vila <[email protected]> (supplier of updated unzip package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 11 Mar 2025 16:40:00 +0100
Source: unzip
Architecture: source
Version: 6.0-29
Distribution: unstable
Urgency: medium
Maintainer: Santiago Vila <[email protected]>
Changed-By: Santiago Vila <[email protected]>
Closes: 661956 1054628 1064000 1072396 1098043
Changes:
 unzip (6.0-29) unstable; urgency=medium
 .
   * Ignore invalid "Total number of disks" field on Microsoft ZIP64 files.
     Closes: #661956, #1064000.
   * Drop conflicting declarations of gmtime() and localtime().
     Should fix build with gcc-15. Closes: #1098043.
   * Fix zipgrep handling of escapes. Closes: #1054628.
   * Stop using update-mime. Closes: #1072396.
   * Add debian/source/lintian-overrides for *.a files.
   * Do not trim Debian changelog.
   * Add debian/salsa-ci.yml.
   * Add Vcs-Git and Vcs-Browser fields.
   * Update Standards-Version.
Checksums-Sha1:
 311f4369403f705b565bce73c67ee322257c80a5 1464 unzip_6.0-29.dsc
 60d291e40b4cba025591bdd84f1b00779f9c68d6 25876 unzip_6.0-29.debian.tar.xz
 ed5157d272435e5e936a5c529911c204040545b3 4929 unzip_6.0-29_source.buildinfo
Checksums-Sha256:
 ecc73beeb9a18f354124b87f6713facb726ffd4b732ce7a6e144d073a1e777ae 1464 
unzip_6.0-29.dsc
 14043e5ea351c02b3bc8676e1e6d20d79b9a690b6d7520e8138ac629cc048417 25876 
unzip_6.0-29.debian.tar.xz
 de7cad7bced0f3e15702031550791d2ebb91094f2db417851f3827f3eed6e308 4929 
unzip_6.0-29_source.buildinfo
Files:
 85732d7b235f5968905f9e346e6e9807 1464 utils optional unzip_6.0-29.dsc
 995666984c9bbc240c45f2d670d28e60 25876 utils optional 
unzip_6.0-29.debian.tar.xz
 71cfc2e9960a4ffbb12e0c7a755ef5b0 4929 utils optional 
unzip_6.0-29_source.buildinfo


-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEE1Uw7+v+wQt44LaXXQc5/C58bizIFAmfQXikACgkQQc5/C58b
izKLHQf/UlwlYafdOqMtBH1rkAZJkpgF4bdYjDuCr3uSReRtCwyFZdqk/IsoC/Vl
6QU208llYOM40/ejZI6s77uCNMnFR+o4339Sk9RpLI/xYshDoCMxHHei7bHSk+5Y
ncsOTP2iFyTdKiEBPzVSmpmPEn03vSFzqRu98D7gaYGJ1nOTNHuE/E/r1zPO0T2I
tFnn/451M9vmpmTGVuPJCnGPKuJd9TUL4RzQZYtXd105qAHLNmJLO0z5AqrSRcqR
QFAVUfP3KHmLbol9oCdrietn5M/T4490FL3BcBTw694P842F7MgNiLMFvhUK36rj
spTtBK0poKVyCjj9Fiv8x0DMBANAVw==
=ET64
-----END PGP SIGNATURE-----

Attachment: pgpNwkQ8Hpv8T.pgp
Description: PGP signature


--- End Message ---

Reply via email to