bug-bash
[Top][All Lists]
Advanced

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

Re: Process substitution can leak CTLESC (0x01) in output


From: Chet Ramey
Subject: Re: Process substitution can leak CTLESC (0x01) in output
Date: Fri, 17 Feb 2017 11:34:44 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1

On 2/16/17 3:36 PM, David Simmons wrote:
> [ Re-sending... it doesn't look like this went through the first time. ]
> 
> Bash uses 0x01 (CTLESC) and 0x7F (CTLNUL) bytes within command word strings
> that are passed around internally.  If either of these bytes appear in the
> parser input, they are escaped with an extra 0x01 (CTLESC), but such
> escaping is reverted before final use.
> 
> When I use ANSI-C quoting to represent these bytes in a process
> substitution context, they appear to be CTLESC-encoded twice in their
> journey through bash.  For example, 7F becomes 01 7F which becomes 01 01 01
> 7F, then decoded once as 01 7F before final use.  This leads to spurious
> 0x01 bytes.

Thanks for the report. This exists as far back as bash-2.05b, and probably
dates from the initial process substitution implementation in the early
1990s.

It will be fixed in the next release of bash.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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