[Zope-dev] Very, very strange problem with 2_4-branch

Matt Behrens matt.behrens@kohler.com
Fri, 25 Jan 2002 11:49:44 -0500


After upgrading to 2_4-branch, I started having some problems with 
authentication, or so I thought.  I have a standard user folder in the 
root and an XUF in a top-level folder.

After much wailing and gnashing of teeth, I dug into _check_context, and 
added a debug statement, now I have:

     def _check_context(self, object):
         # Check that 'object' exists in the acquisition context of
         # the parent of the acl_users object containing this user,
         # to prevent "stealing" access through acquisition tricks.
         # Return true if in context, false if not or if context
         # cannot be determined (object is not wrapped).
         parent  = getattr(self, 'aq_parent', None)
         context = getattr(parent, 'aq_parent', None)
         if context is not None:
             if object is None:
                 return 1
             if not hasattr(object, 'aq_inContextOf'):
                 if hasattr(object, 'im_self'):
                     # This is a method.  Grab its self.
                     object=object.im_self
                 if not hasattr(object, 'aq_inContextOf'):
                     # Object is not wrapped, so return false.
                     return 0
             zLOG.LOG('BasicUser._check_context', zLOG.DEBUG,
                      '%s.aq_inContextOf(%s, 1) returned %d' % 
(object.getPhysicalPath(), context.getPhysicalPath(), 
object.aq_inContextOf(context, 1)))
             return object.aq_inContextOf(context, 1)

I am getting the following log output:

2002-01-25T16:36:23 DEBUG(-200) BasicUser._check_context ('', 
'zope').aq_inContextOf(('', 'zope'), 1) returned 1

and

2002-01-25T16:38:07 DEBUG(-200) BasicUser._check_context ('', 'zope', 
'dept', 'is', 'alerts').aq_inContextOf(('', 'zope'), 1) returned 0

Now, the weird part is that this problem is sporadic.  It will go away 
and reappear with some frequency.

Any ideas?  Anyone?