[Zope3-checkins] CVS: Zope3/src/zope/app/fssync - syncer.py:1.17

Guido van Rossum guido@python.org
Thu, 15 May 2003 17:24:52 -0400


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

Modified Files:
	syncer.py 
Log Message:
Create another security hole by using removeAllProxies.

Fix a NameError handling the case where the container generated a new
name; report the old and new name for convenience.

Add another assert that the object corresponding to a directory
indeed implements IObjectDirectory.


=== Zope3/src/zope/app/fssync/syncer.py 1.16 => 1.17 ===
--- Zope3/src/zope/app/fssync/syncer.py:1.16	Thu May 15 15:46:45 2003
+++ Zope3/src/zope/app/fssync/syncer.py	Thu May 15 17:24:52 2003
@@ -132,6 +132,7 @@
             writeFile(data, path)
     else:
         # Directory
+        assert IObjectDirectory.isImplementedBy(adapter)
         if os.path.exists(path):
             dir_entries = os.path.join(path, '@@Zope', 'Entries.xml')
             if os.path.exists(dir_entries):
@@ -155,7 +156,8 @@
         newName = container.setObject(name, ob)
         if newName != name:
             raise SynchronizationError(
-                "Container generated new name for %s" % path)
+                "Container generated new name for %s (new name %s)" %
+                (name, newName))
     else:
         # Not a container, must be a mapping
         container[name] = ob
@@ -263,6 +265,7 @@
             else:
                 # Special case pickle data
                 oldOb = container[name]
+                oldOb = removeAllProxies(oldOb)
                 newOb = loadFile(path)
                 try:
                     # See if we can and should just copy the state