From 61d83c6d6b23ea0fa3f99dfb53bf47c727c5a1c6 Mon Sep 17 00:00:00 2001 From: Joshua Lock Date: Fri, 12 Aug 2011 17:58:11 -0700 Subject: Ensure only the filtered environment variables are inherited from the OS The recent change which modified inheritFromOS to use the intial environment, rather than the current environment, introduced a bug such that variables which had been cleaned from the environment where still set in the data store. This patch changes things such that a list of approved environment variables is saved after the environment is cleaned and only the variables in this list are inherited in inheritFromOS. CC: James Limbouris CC: Chris Larson (Bitbake rev: cb6c07054e8baf94614713ec257c643b22266d75) Signed-off-by: Joshua Lock Signed-off-by: Richard Purdie --- bitbake/lib/bb/data.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'bitbake/lib/bb/data.py') diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 65144bfe52..ac0d8809cc 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py @@ -159,16 +159,17 @@ def expandKeys(alterdata, readdata = None): ekey = todolist[key] renameVar(key, ekey, alterdata) -def inheritFromOS(d, savedenv): +def inheritFromOS(d, savedenv, permitted): """Inherit variables from the initial environment.""" exportlist = bb.utils.preserved_envvars_exported() for s in savedenv.keys(): - try: - setVar(s, getVar(s, savedenv, True), d) - if s in exportlist: - setVarFlag(s, "export", True, d) - except TypeError: - pass + if s in permitted: + try: + setVar(s, getVar(s, savedenv, True), d) + if s in exportlist: + setVarFlag(s, "export", True, d) + except TypeError: + pass def emit_var(var, o=sys.__stdout__, d = init(), all=False): """Emit a variable to be sourced by a shell.""" -- cgit v1.2.3-54-g00ecf