[Zope3-checkins] CVS: Zope3/src/zope/app/services - module.py:1.13

Jim Fulton jim@zope.com
Sat, 12 Jul 2003 05:41:24 -0400


Update of /cvs-repository/Zope3/src/zope/app/services
In directory cvs.zope.org:/tmp/cvs-serv27002

Modified Files:
	module.py 
Log Message:

Removed the security proxy around the folder when using the folder to
look up modules during import.

We are currently only supporting trusted code.
We don't want the folder to be proxied because, if it is, then
the modules will be proxied.

When we do support untrusted code, we're going to have to do
something different.


=== Zope3/src/zope/app/services/module.py 1.12 => 1.13 ===
--- Zope3/src/zope/app/services/module.py:1.12	Mon Jun 30 12:25:22 2003
+++ Zope3/src/zope/app/services/module.py	Sat Jul 12 05:41:19 2003
@@ -17,20 +17,18 @@
 """
 
 from persistence import Persistent
-from zodb.code.module import PersistentModule, compileModule
 from zodb.code.interfaces import IPersistentModuleImportRegistry
 from zodb.code.interfaces import IPersistentModuleUpdateRegistry
-
-from zope.interface import implements
-
-from zope.app import zapi
+from zodb.code.module import PersistentModule, compileModule
 from zope.app.event import function
 from zope.app.fssync.classes import ObjectEntryAdapter, AttrMapping
+from zope.app import zapi
 from zope.app.interfaces.annotation import IAttributeAnnotatable
-from zope.app.interfaces.fssync import IObjectFile
 from zope.app.interfaces.file import IFileFactory
+from zope.app.interfaces.fssync import IObjectFile
 from zope.app.interfaces.services.module import IModuleManager
-
+from zope.interface import implements
+from zope.security.proxy import trustedRemoveSecurityProxy
 
 class Manager(Persistent):
 
@@ -59,7 +57,18 @@
             mod = self._module
         except AttributeError:
             mod = self._module = PersistentModule(self.name)
+
+
         folder = zapi.getWrapperContainer(self)
+
+        # XXX
+        # We are currently only supporting trusted code.
+        # We don't want the folder to be proxied because, if it is, then
+        # the modules will be proxied.
+        # When we do support untrusted code, we're going to have to do
+        # something different.
+        folder = trustedRemoveSecurityProxy(folder)
+            
         compileModule(mod, folder, self.source)
         self._recompile = False