aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/sandbox.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2006-12-30 03:06:57 +0000
committerPJ Eby <distutils-sig@python.org>2006-12-30 03:06:57 +0000
commit981bc8e3da37dda70f06d59b81b4dc694f1c48df (patch)
tree4c5c517798154aff780235eefad065a3c124cc8d /setuptools/sandbox.py
parentdfa0c16ada9f7dcc6aadf8cf2400bfb291ba8ce2 (diff)
downloadexternal_python_setuptools-981bc8e3da37dda70f06d59b81b4dc694f1c48df.tar.gz
external_python_setuptools-981bc8e3da37dda70f06d59b81b4dc694f1c48df.tar.bz2
external_python_setuptools-981bc8e3da37dda70f06d59b81b4dc694f1c48df.zip
Fix os.open() sandboxing code that refused anything but read-only access.
(backport from trunk) --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053199
Diffstat (limited to 'setuptools/sandbox.py')
-rwxr-xr-xsetuptools/sandbox.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/setuptools/sandbox.py b/setuptools/sandbox.py
index 3874a4f9..4db0dbdb 100755
--- a/setuptools/sandbox.py
+++ b/setuptools/sandbox.py
@@ -189,8 +189,8 @@ class DirectorySandbox(AbstractSandbox):
def open(self, file, flags, mode=0777):
"""Called for low-level os.open()"""
- if flags & WRITE_FLAGS:
- self._violation("open", file, flags, mode)
+ if flags & WRITE_FLAGS and not self._ok(file):
+ self._violation("os.open", file, flags, mode)
return _os.open(file,flags,mode)