summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-09-08 06:51:59 +0000
committerZac Medico <zmedico@gentoo.org>2007-09-08 06:51:59 +0000
commitff8a98f4b34dfd6ff2e589648a1e9020d7417eb3 (patch)
treec882295c69353238a5934683268acea86b00af67
parentdee01d0e9a0a02e8ed742cb055bfeb85b0a30030 (diff)
downloadportage-ff8a98f4b34dfd6ff2e589648a1e9020d7417eb3.tar.gz
portage-ff8a98f4b34dfd6ff2e589648a1e9020d7417eb3.tar.bz2
portage-ff8a98f4b34dfd6ff2e589648a1e9020d7417eb3.zip
Bug #190268 - Avoid unwanted sandbox violations in src_test().
- Allow SANDBOX_* variables to pass through. - Don't try to create an sandbox instance inside a test case in order to interaction with SANDBOX_* variables in src_test(). svn path=/main/trunk/; revision=7759
-rw-r--r--pym/portage/__init__.py3
-rw-r--r--pym/portage/tests/ebuild/test_spawn.py10
2 files changed, 10 insertions, 3 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 62648ee87..e11b8f419 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1201,8 +1201,7 @@ class config(object):
# Blacklist vars that could interfere with portage internals.
for blacklisted in "CATEGORY", "PKGUSE", "PORTAGE_CONFIGROOT", \
- "ROOT", "SANDBOX_DENY", "SANDBOX_PREDICT", "SANDBOX_READ", \
- "SANDBOX_WRITE":
+ "ROOT":
for cfg in self.lookuplist:
cfg.pop(blacklisted, None)
del blacklisted, cfg
diff --git a/pym/portage/tests/ebuild/test_spawn.py b/pym/portage/tests/ebuild/test_spawn.py
index 66e8f9ea7..f582723bc 100644
--- a/pym/portage/tests/ebuild/test_spawn.py
+++ b/pym/portage/tests/ebuild/test_spawn.py
@@ -16,8 +16,16 @@ class SpawnTestCase(TestCase):
os.close(fd)
null_fd = os.open('/dev/null', os.O_RDWR)
test_string = 2 * "blah blah blah\n"
+ # Test cases are unique because they run inside src_test() which
+ # may or may not already be running within a sandbox. Interaction
+ # with SANDBOX_* variables may trigger unwanted sandbox violations
+ # that are only reproducible with certain combinations of sandbox,
+ # usersandbox, and userpriv FEATURES. Attempts to filter SANDBOX_*
+ # variables can interfere with a currently running sandbox
+ # instance. Therefore, use free=1 here to avoid potential
+ # interactions (see bug #190268).
spawn("echo -n '%s'" % test_string, settings, logfile=logfile,
- fd_pipes={0:sys.stdin.fileno(), 1:null_fd, 2:null_fd})
+ free=1, fd_pipes={0:sys.stdin.fileno(), 1:null_fd, 2:null_fd})
os.close(null_fd)
f = open(logfile, 'r')
log_content = f.read()