Bug #253467 - Don't allow alien $A values to leak into the ebuild environment.
authorZac Medico <zmedico@gentoo.org>
Mon, 12 Jan 2009 08:13:47 +0000 (08:13 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 12 Jan 2009 08:13:47 +0000 (08:13 -0000)
(trunk r12379)

svn path=/main/branches/2.1.6/; revision=12449

pym/portage/__init__.py

index ed688269bf90c2e5f3e8cf8464bc45e6a38c803e..decedb8228e43d4d4d3d3672a3516be97d131636 100644 (file)
@@ -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
@@ -1899,8 +1903,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: