[Zope3-checkins] CVS: Zope3/src/zope/app/fssync - classes.py:1.4

Guido van Rossum guido@python.org
Thu, 15 May 2003 12:19:04 -0400


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

Modified Files:
	classes.py 
Log Message:
In the default adapter, remove all proxies, so that we can sync object
types for which no specific adapter exists.  This is a security
concern, obviously.  We'll review that later, when all occurrences of
removeAllProxies are reviewed.


=== Zope3/src/zope/app/fssync/classes.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/fssync/classes.py:1.3	Tue May  6 15:58:44 2003
+++ Zope3/src/zope/app/fssync/classes.py	Thu May 15 12:19:04 2003
@@ -23,6 +23,7 @@
 from zope.app.interfaces.fssync import IFSAddView, IObjectFile
 from zope.component.interfaces import IPresentationRequest
 from zope.xmlpickle import dumps
+from zope.proxy.introspection import removeAllProxies
 
 class FSAddView(object):
     """See IFSAddView."""
@@ -88,6 +89,7 @@
 
     def extra(self):
         "See Zope.App.FSSync.IObjectEntry.IObjectEntry"
+        return None
 
     def typeIdentifier(self):
         "See Zope.App.FSSync.IObjectEntry.IObjectEntry"
@@ -104,6 +106,10 @@
     """Default File-system representation for objects."""
 
     __implements__ =  IObjectFile
+
+    def __init__(self, context):
+        # XXX for now, remove all proxies.
+        ObjectEntryAdapter.__init__(self, removeAllProxies(context))
 
     def getBody(self):
         "See IObjectFile"