[Python-checkins] r53198 - sandbox/trunk/setuptools/setuptools/sandbox.py

phillip.eby python-checkins at python.org
Sat Dec 30 04:06:09 CET 2006


Author: phillip.eby
Date: Sat Dec 30 04:06:09 2006
New Revision: 53198

Modified:
   sandbox/trunk/setuptools/setuptools/sandbox.py
Log:
Fix os.open() sandboxing code that refused anything but read-only access.


Modified: sandbox/trunk/setuptools/setuptools/sandbox.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/sandbox.py	(original)
+++ sandbox/trunk/setuptools/setuptools/sandbox.py	Sat Dec 30 04:06:09 2006
@@ -189,8 +189,8 @@
 
     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)
 
 


More information about the Python-checkins mailing list