Mappings to folders inside localfs objects aren't accepted
Hi, I have a VirtualHostMonster on the root of my zope server (version 2.6.1). On the past (on 2.5.1 I think), I added some mappings to folders inside localfs objects and it worked. Now, I'm trying to add new mappings and the problem is that the previous mappings that I made become invalid and are followed by the text: "#! Path must lead to an Object Manager" I found that the problem is the following validation in the VirtualHostMonster.py file: -- if not getattr(ob.aq_base, 'isAnObjectManager', 0): ---- raise 'LineError', ('Path must lead to ' ---- 'an Object Manager') I removed it, restarted zope, and it worked. Does this also happen with the latest versions of zope? is this a bug? Thanks, Josef
I found that the problem is the following validation in the VirtualHostMonster.py file:
-- if not getattr(ob.aq_base, 'isAnObjectManager', 0): ---- raise 'LineError', ('Path must lead to ' ---- 'an Object Manager')
I removed it, restarted zope, and it worked. Does this also happen with the latest versions of zope? is this a bug?
I wouldn't classify it as a bug, more like an attempt to make sure people don't shoot themselves in the foot too badly. You should be able to go into the LocalFS sources and ensure that those "folder wrapper" objects do set an attribute "isAnObjectManager". jens
I wouldn't classify it as a bug, more like an attempt to make sure people don't shoot themselves in the foot too badly. Ok, just one security restriction more. But I think a LocalFS and its subfolders (LocalDirectories) should be also considered as ObjectManagers.
You should be able to go into the LocalFS sources and ensure that those "folder wrapper" objects do set an attribute "isAnObjectManager". I have already done it, but you have also to mention that you have to create the LocalFS objects again, so that they store the new attribute.
For the interested, this is what I did: 1) In LocalFS.py: Add "self.isAnObjectManager=1" to the __init__ methods of the classes LocalDirectory and LocalFS. 2) Delete your LocalFS object and create it again. I guess you can also solve this by adding a __setstate__ method to both classes, then add the new attribute there; or you can also create a script that search for all the LocalFS objects and add this attribute but I preffer the first solution, for I don't have many LocalFS objects. Thanks, Josef
On Thu, Jan 08, 2004 at 06:26:24PM +0100, Josef Meile wrote:
For the interested, this is what I did:
1) In LocalFS.py: Add "self.isAnObjectManager=1" to the __init__ methods of the classes LocalDirectory and LocalFS.
2) Delete your LocalFS object and create it again. I guess you can also solve this by adding a __setstate__ method to both classes, then add the new attribute there; or you can also create a script that search for all the LocalFS objects and add this attribute but I preffer the first solution, for I don't have many LocalFS objects.
2) is not necessary if you do "isAnObjectManager=1" in class scope of LocalFS and LocalDirectory, instead of setting it on each instance. btw, I haven't heard of isAnObjectManager before. Is this a replacement for isPrincipiaFolderish? I notice that OFS/ObjectManager.py defines both. -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's MYSTICAL MONKEY PERFORMANCE ARTIST! (random hero from isometric.spaceninja.com)
On Thu, Jan 08, 2004 at 12:53:19PM -0500, Paul Winkler wrote:
btw, I haven't heard of isAnObjectManager before. Is this a replacement for isPrincipiaFolderish? I notice that OFS/ObjectManager.py defines both.
Answering my own question... http://mail.zope.org/pipermail/zope/2002-March/111486.html Based on that, I have to wonder whether VirtualHostMonster is checking the wrong thing. It wants to map to something folderish, but why does it matter whether the folderish thing is ObjectManagerish? -- Paul Winkler http://www.slinkp.com Look! Up in the sky! It's LOVESICK BOOT STENOGRAPHER! (random hero from isometric.spaceninja.com)
participants (3)
-
Jens Vagelpohl -
Josef Meile -
Paul Winkler