mirror of
https://git.tukaani.org/xz.git
synced 2026-10-31 19:34:55 +00:00
xzgrep: Fix handling of the ' char at the end of an option
For example, the following would run the "id" command:
xzgrep "--a='" "--b=;id;'" "pattern" foo.xz
The bug was inherited from gzip's zgrep. It was reported to bug-gzip by
Leenear. It was fixed in gzip in the commit cd74dc30f8cc by Paul Eggert.
Link: https://lists.gnu.org/archive/html/bug-gzip/2026-04/msg00032.html
This commit is contained in:
parent
2928248922
commit
1df00237ae
@ -147,7 +147,7 @@ while test $# -ne 0; do
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
case $option in
|
case $option in
|
||||||
(*\'?*)
|
(*\'*)
|
||||||
option=\'$(printf '%sX\n' "$option" | LC_ALL=C sed "$escape");;
|
option=\'$(printf '%sX\n' "$option" | LC_ALL=C sed "$escape");;
|
||||||
(*)
|
(*)
|
||||||
option="'$option'";;
|
option="'$option'";;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user