bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

quoted string expansions of octal \001 value occurs twice in Process Sub


From: Anthony DeDominic
Subject: quoted string expansions of octal \001 value occurs twice in Process Substitution
Date: Fri, 22 Sep 2017 17:55:06 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H   -I.  -I../. -I.././include -I.././lib
-Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
-fdebug-prefix-map=/build/bash-7fckc0/bash-4.4=.
-fstack-protector-strong -Wformat -Werror=format-security -Wall -no-pie
-Wno-parentheses -Wno-format-security
uname output: Linux thegibson 4.12.0-1-amd64 #1 SMP Debian 4.12.6-1
(2017-08-12) x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 4.4
Patch Level: 12
Release Status: release

Description:

an octal/hex value of ctrl-a (\001) expanded by a quoted string
expansion appears to expand twice when in a process substitution.

Repeat-By:

    >(echo -n $'\001' | wc -c)
    outputs 2 (ignoring the permission denied error)
    echo -n $'\001' | wc -c
    outputs 1

eval "$(for i in {01..77}; do (( 10#$i % 10 > 7 )) && continue; echo^M
'>(echo -n $'"'\0$i'"' >>test)'; done)"

using `xxd test` you can see there are only repeating \001's
00000000: 0101 0203 0405 0607 0809 0a0b 0c0d 0e0f  ................
...etc

no process substitution
eval "$(for i in {01..77}; do (( 10#$i % 10 > 7 )) && continue; echo
'echo -n $'"'\0$i'"' >>test2'; done)"
`xxd test2`
00000000: 0102 0304 0506 0708 090a 0b0c 0d0e 0f10  ................
...etc

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]