bug-bash
[Top][All Lists]
Advanced

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

Re: CTLESC and CTLNUL not dequoted in exported function definitions


From: Grisha Levit
Subject: Re: CTLESC and CTLNUL not dequoted in exported function definitions
Date: Sun, 9 Apr 2017 18:12:53 -0400

On Sun, Apr 9, 2017 at 5:56 PM, Chet Ramey <address@hidden> wrote:
> Thanks for the report and fix.  This is the patch where you could have used
> dequote_escapes() ;-) .

Yup, I realized I'd done the previous one incorrectly shortly after writing
this one, sorry about that.

But I'm not sure about dequoting the function name, so I wanted to dequote
just the value, not the whole sting pointed to by q.  In retrospect, maybe
I should have clarified that issue first:

$ eval $'\001() { :; }'
$ declare -F | xxd
00000000: 6465 636c 6172 6520 2d66 2001 010a       declare -f ...
                                     ^^ ^^

The actual function that's created actually *is* $'\001\001':

$ type -t $'\001'
$ type -t $'\001\001'
function

So I was assuming the error is with not dequoting the function name *before*
the function is created and that when mk_env_string is called `name' would
already be dequoted and `value' would not be.



reply via email to

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