diff options
author | PJ Eby <distutils-sig@python.org> | 2006-12-30 03:06:57 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2006-12-30 03:06:57 +0000 |
commit | 981bc8e3da37dda70f06d59b81b4dc694f1c48df (patch) | |
tree | 4c5c517798154aff780235eefad065a3c124cc8d /setuptools/sandbox.py | |
parent | dfa0c16ada9f7dcc6aadf8cf2400bfb291ba8ce2 (diff) | |
download | external_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-x | setuptools/sandbox.py | 4 |
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) |