[oe] Remove SHELL from preserved_envvars_exported?

Phil Blundell philb at gnu.org
Mon Jun 27 13:58:50 UTC 2011


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?

p.






More information about the Openembedded-devel mailing list