[pypy-svn] r45819 - in pypy/branch/pypy-more-rtti-inprogress: rpython translator/sandbox/test

arigo at codespeak.net arigo at codespeak.net
Fri Aug 17 17:04:58 CEST 2007


Author: arigo
Date: Fri Aug 17 17:04:57 2007
New Revision: 45819

Modified:
   pypy/branch/pypy-more-rtti-inprogress/rpython/extfuncregistry.py
   pypy/branch/pypy-more-rtti-inprogress/translator/sandbox/test/test_sandbox.py
Log:
os.path.join() is safe.


Modified: pypy/branch/pypy-more-rtti-inprogress/rpython/extfuncregistry.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/rpython/extfuncregistry.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/rpython/extfuncregistry.py	Fri Aug 17 17:04:57 2007
@@ -70,4 +70,5 @@
 for name, args, res in path_functions:
     func = getattr(os.path, name)
     llimpl = func_with_new_name(func, name)
-    _register_external(func, args, res, 'll_os_path.ll_%s' % name, llimpl=llimpl)
+    _register_external(func, args, res, 'll_os_path.ll_%s' % name,
+                       llimpl=llimpl, sandboxsafe=True)

Modified: pypy/branch/pypy-more-rtti-inprogress/translator/sandbox/test/test_sandbox.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/translator/sandbox/test/test_sandbox.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/translator/sandbox/test/test_sandbox.py	Fri Aug 17 17:04:57 2007
@@ -121,3 +121,9 @@
             print
             return 0
         self.run(entry_point, ["3.011"], "2 4 13 75 2 1 3\n")
+
+    def test_os_path_safe(self):
+        def entry_point(argv):
+            print os.path.join('tmp', argv[1])
+            return 0
+        self.run(entry_point, ["spam"], os.path.join("tmp", "spam")+'\n')



More information about the Pypy-commit mailing list