[OE-core] [PATCH] QemuRunner: avoid tainting os.environ

Richard Purdie richard.purdie at linuxfoundation.org
Wed May 3 12:53:20 UTC 2017


On Wed, 2017-05-03 at 14:17 +0200, Patrick Ohly wrote:
> On Wed, 2017-05-03 at 13:00 +0100, Burton, Ross wrote:
> > 
> > 
> > On 3 May 2017 at 12:53, Patrick Ohly <patrick.ohly at intel.com>
> > wrote:
> >         Then it wouldn't get logged. Not a particularly strong
> >         argument, though.
> >         If that's preferred, I can change the implementation.
> >         
> > 
> > 
> > I prefer the clarity of copying os.environ and adding to it over
> > running env, especially as you have whitespace/quoting to deal
> > with.
> > The variables added to the environment could easily be logged
> > separately, surely?
> They could be logged in start(), but at the moment the logging is in
> launch(), and if we keep the semantic the same as in
> subprocess.Popen()
> (i.e. caller provides entire environment), then that logging doesn't
> know which env variables might be worth logging.
> 
> Anyway, the variables weren't logged before either, so I'll just keep
> that and change to passing an env dict.

You could pass in the specific env delta you want to the function and
leave launch to infill anything which isn't set?

Cheers,

Richard



More information about the Openembedded-core mailing list