bug-bash
[Top][All Lists]
Advanced

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

Re: coproc and existing variables


From: Chet Ramey
Subject: Re: coproc and existing variables
Date: Mon, 23 May 2016 13:37:48 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:45.0) Gecko/20100101 Thunderbird/45.1.0

On 5/23/16 12:45 PM, Grisha Levit wrote:
> On Thu, May 19, 2016 at 11:05 AM, Chet Ramey <chet.ramey@case.edu
> <mailto:chet.ramey@case.edu>> wrote:
> 
>     >       * The %s_PID variable is unbound unconditionally
>     >
>     > BTW, this is exploitable for unsetting read-only variables.
> 
>     Same change as for getopts.
> 
> This should probably instead be the same change as was previously done for
> unsetting the FD array variable, i.e.:

I disagree.  The idea is that by the time the coproc gets destroyed, the
xxx_PID variable had better be gone.  It's documented as being managed by
the coproc command, and if you choose to use it yourself, all bets are
off, similarly to how getopts manages $OPTARG.  The only question is
whether or not the coproc command should remove any existing variable
before binding it in the first place.

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



reply via email to

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