[Top][All Lists]

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

Re: read-only flag is lost for functions in sub shells

From: Linda Walsh
Subject: Re: read-only flag is lost for functions in sub shells
Date: Fri, 01 Aug 2014 15:47:00 -0700
User-agent: Thunderbird

Greg Wooledge wrote:
On Thu, Jul 31, 2014 at 04:45:20PM -0700, Linda Walsh wrote:
Also noticing broken-ness upon using "sudo": functions are undefined...

Some implementations of sudo clear the environment before elevating
privileges.  Clearing the environment would also remove exported
functions, which are encoded as environment variables.  You might be
able to configure sudo to preserve your environment, but doing so is
well beyond the scope of bug-bash.
The note in says there are two ways to deal with
environment variables, "reset" w/whitelist or
no-reset w/blacklist.  Then it tells you:
"In all cases, environment variables with a value beginning with () are
     removed as they could be interpreted as bash functions. "

sudo is seriously broken in this regard, though I can't
see where / when this change went in (i.e. quite possibly,
been there, and my auto-scripted files reread in the definitions).

reply via email to

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