[Zope-dev] Puzzling change to guarded_getitem in Zope 2.8

Richard Jones richard at commonground.com.au
Thu Aug 25 20:58:02 EDT 2005


On Fri, 26 Aug 2005 10:00 am, Richard Jones wrote:
> I'm migrating our 2.7-developed Product to 2.8. The following change has me
> puzzled. In 2.7,  AccessControl.ZopeGuards guarded_getitem has the
> following code:

OK, Tres made the change, with the relevant bit of the log message being:

    Iteration over sequences could in some cases fail to check access
    to an object obtained from the sequence. Subsequent checks (such
    as for attributes access) of such an object would still be
    performed, but it should not have been possible to obtain the
    object in the first place.

    List and dictionary instance methods such as the get method of
    dictionary objects were not security aware and could return an
    object without checking access to that object. Subsequent checks
    (such as for attributes access) of such an object would still be
    performed, but it should not have been possible to obtain the
    object in the first place.

So I presume that the change *intended* to move the onus of validation from 
the guarded_getitem method to the __getitem__ method of the container? No 
more trusted access to custom (ie. not builtin) sequence/mapping objects?


     Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20050826/52480d97/attachment.bin


More information about the Zope-Dev mailing list