Commit 981bc8e3 authored by PJ Eby's avatar PJ Eby

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
parent dfa0c16a
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment