bug-bash
[Top][All Lists]
Advanced

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

Re: REGRESSION: shellshock patch rejects valid function names


From: Eric Blake
Subject: Re: REGRESSION: shellshock patch rejects valid function names
Date: Sat, 27 Sep 2014 15:12:13 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0

On 09/27/2014 02:57 PM, Arfrever Frehtes Taifersar Arahesis wrote:
> 2014-09-27 22:29 Eric Blake napisał(a):
>> Thankfully, bash already forbids trying to name a function 'a=b'
> 
> It works in bash 4.3.26:
> 
> $ function a=b() { echo A; }
> $ "a=b"
> A

Oh, you used the 'function' keyword, coupled with NOT quoting the name
of the function.  I was trying to create the name via quotation:

$ bash -c 'a\=b () { echo hi; }; a\=b'
bash: `a\=b': not a valid identifier
bash: a=b: command not found

Still, since I strongly believe that import/export and valid function
names should be the same set of characters, but that it would be
extremely difficult to unambiguously encode = into environment variable
function names, I think that we SHOULD take the step of forbidding '='
in function names (the 'function' keyword should NOT be able to define
any function that cannot also be defined in isolation, nor which cannot
be imported from the environment using whatever improved implementation
we decide for function export/import).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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