diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-01-04 02:52:17 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-01-04 02:52:17 +0000 |
commit | 69534c29692829c756193009eb1fca84ae7012aa (patch) | |
tree | d444a184269a284e55eac43a54442b4d1ffbc23c | |
parent | 30d9cf0c0c525fe229c941d4082ae5d94ba8c350 (diff) | |
download | portage-69534c29692829c756193009eb1fca84ae7012aa.tar.gz portage-69534c29692829c756193009eb1fca84ae7012aa.tar.bz2 portage-69534c29692829c756193009eb1fca84ae7012aa.zip |
Bug #253467 - Don't allow alien $A values to leak into the ebuild environment.
svn path=/main/trunk/; revision=12379
-rw-r--r-- | pym/portage/__init__.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index cfb4e616b..753980388 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -914,6 +914,12 @@ class config(object): virtuals ...etc you look in here. """ + _env_blacklist = [ + "A", "AA", "CATEGORY", "EBUILD_PHASE", "EMERGE_FROM", + "PF", "PKGUSE", "PORTAGE_CONFIGROOT", "PORTAGE_IUSE", + "PORTAGE_USE", "ROOT" + ] + _environ_whitelist = [] # Whitelisted variables are always allowed to enter the ebuild @@ -1432,9 +1438,7 @@ class config(object): self.lookuplist.reverse() # Blacklist vars that could interfere with portage internals. - for blacklisted in "CATEGORY", "EBUILD_PHASE", \ - "EMERGE_FROM", "PKGUSE", "PORTAGE_CONFIGROOT", \ - "PORTAGE_IUSE", "PORTAGE_USE", "ROOT": + for blacklisted in self._env_blacklist: for cfg in self.lookuplist: cfg.pop(blacklisted, None) del blacklisted, cfg @@ -1909,8 +1913,6 @@ class config(object): env_configdict = self.configdict["env"] pkg_configdict = self.configdict["pkg"] previous_iuse = pkg_configdict.get("IUSE") - for k in ("A", "AA", "CATEGORY", "PKGUSE", "PF", "PORTAGE_USE"): - env_configdict.pop(k, None) pkg_configdict["CATEGORY"] = cat pkg_configdict["PF"] = pf if mydb: |