[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] using functions passed as environment variables after th
From: |
Eric Blake |
Subject: |
Re: [Help-bash] using functions passed as environment variables after the vulnerability fix |
Date: |
Fri, 26 Sep 2014 14:56:25 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 |
On 09/26/2014 02:01 PM, Wendy Palm wrote:
> We updated our system to the latest fix, but find passing functions via an
> environment variable isn't working at all.
> Was that the intent of the fix? Or am I trying to do it incorrectly?
>
> It's a CentOS 6.5 system, with bash-4.1.2-15.el6_5.2.x86_64
>
> # env 'x=() { echo "functions still work"; }' bash -c x
> bash: x: command not found
Read the documentation. Red Hat (and therefore CentOS) uses a new
syntax for manually-created functions. You must either export your
functions using bash, or use the new syntax:
https://access.redhat.com/articles/1200223
$ env 'BASH_FUNC_x()=() { echo "functions still work"; }' bash -c x
functions still work
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature