FS#76905 - [unzip] zipgrep fails to search files named "-e" or "-n" (among others)
Attached to Project:
Arch Linux
Opened by Lex (lexbailey) - Wednesday, 21 December 2022, 17:41 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:17 GMT
Opened by Lex (lexbailey) - Wednesday, 21 December 2022, 17:41 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:17 GMT
|
Details
Description:
zipgrep fails to search files with specific file names inside zip files. This issue is peculiar to systems where /bin/sh is bash, as is (afaict) the default for Arch. (For example, this works fine on debian where /bin/sh is dash by default) any zip file that contains files with the following names will show this bug: -e -n -E -en ...etc In summary: if the file name starts with a dash and is followed only by characters in [neE] then this problem occurs. zipgrep tries to process each file name by echoing it into another command, but bash's echo interprets files with names like these as if they are options to echo and thus does not echo them. A fix that works for me is to swap the echo for a printf: 72c72 < i=` echo "$i" | \ --- > i=` printf '%s' "$i" | \ However, given that this works fine on not-bash shells I suspect that the upstream response to a patch like this would be "just use dash or similar". This is of course a valid option, to make this package depend on dash and then change the #! line Additional info: * package version: 6.0-19 Steps to reproduce: Consider the following bash session... $ echo bar > -e $ zip e.zip -- -e adding: -e (stored 0%) $ zipgrep bar e.zip caution: filename not matched: $ I would not expect to see "caution: filename not matched:" instead, I would expect "-e: bar" |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:17 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/unzip/issues/2
Saturday, 25 November 2023, 20:17 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/unzip/issues/2
[1] https://wiki.archlinux.org/title/Bug_reporting_guidelines#Upstream_or_Arch%3F
However, I did attempt to contact the upstream maintainers to ask if they were interested in this issue, it has been about a month since I tried, I got no reply.
Perhaps you already have a relationship with the upstream maintainers and know a better way to contact them?