[oe] Remove SHELL from preserved_envvars_exported?

Chris Larson clarson at kergoth.com
Mon Jun 27 14:03:30 UTC 2011


On Mon, Jun 27, 2011 at 6:58 AM, Phil Blundell <philb at gnu.org> wrote:
> One of my colleagues pointed out to me just now that $SHELL is, somewhat
> surprisingly, passed through to bitbake subprocesses from the calling
> environment.  Under most circumstances this would be fairly benign since
> few things actually care about that variable, but it turns out that:
>
> a) flock(1) has the misfeature of using $SHELL rather than /bin/sh if
> the former is set in the environment (in contrast to system(3), which
> always uses /bin/sh); and
>
> b) zsh has the misfeature of always reading ~/.zshenv even if it was
> invoked as "zsh -c ...".
>
> So the net result of all this is that, if you are using zsh as your
> interactive shell, the contents of your .zshenv end up in the
> environment for everything that's run under flock and bad results can
> potentially ensue.  In our particular case my colleague was setting
> $PATH from his .zshenv with predictably unfortunate consequences.
>
> It isn't very obvious to me that having SHELL whitelisted is sensible
> for anything except interactive tasks.  Does anybody know of a reason
> why it needs to be included everywhere?
>

I don't know why it is the way it is right  now, but I want to jump in
here and say that as another zsh user, this has bitten me multiple
times before as well. I actually have SHELL overridden in my
~/.oe/conf/site.conf to work around it for now. I agree that it should
probably not be exported other than for interactive tasks, for what
it's worth.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics




More information about the Openembedded-devel mailing list