2.10.5-final PageTemplate returns Unauthorized error while it shouldn't

Bug #174705 reported by Federico G. Schwindt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Undecided
Tres Seaver

Bug Description

The following piece of code works in 2.8 and 2.9 PageTemplates but not in 2.10.5-final:

    <span tal:on-error="python:'blah %s' % error.value">
       <tal:block define="zero_div python:1/0"/>
    </span>

Can anyone confirm this is a bug?
Thanks,

f.-

description: updated
Revision history for this message
Tres Seaver (tseaver) wrote :

Are you seeing the following when rendering that template on 2.10.x:

  AccessControl.unauthorized.Unauthorized: You are not allowed to access 'value' in this context

Revision history for this message
Federico G. Schwindt (fgsch) wrote :

That's what I meant with my report. This is not the case in 2.8 and 2.9 tho.

f.-

Andreas Jung (ajung)
Changed in zope2:
status: New → Confirmed
Revision history for this message
Tres Seaver (tseaver) wrote :

Full traceback attached.

Revision history for this message
Federico G. Schwindt (fgsch) wrote :

The attached diff against 2.11.2 fixes it. This probably needs to be applied to zope3 as well.

f.-

Revision history for this message
Tres Seaver (tseaver) wrote : Re: [Bug 174705] Re: 2.10.5-final PageTemplate returns Unauthorized error while it shouldn't

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Federico Schwindt wrote:
> The attached diff against 2.11.2 fixes it. This probably needs to be
> applied to zope3 as well.
>
> f.-
>
> ** Attachment added: "174705.diff"
> http://launchpadlibrarian.net/20101336/174705.diff

Actually, that fix is not relevant for Zope3's security machinery. We
would be better off adding the
'__allow_access_to_unrestricted_subobjects__' attribute to the
Zope2-specific subclass, Products.PageTemplates.Expressions.ZopeContext,
along with a unit test.

Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 <email address hidden>
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJNCB8+gerLs4ltQ4RAk3wAJ9e8wWt5BdTj59reF/CT8orOtBSDQCfcsi3
8TfvBSKy1VkWHJA8cQJAEC0=
=bt0M
-----END PGP SIGNATURE-----

Revision history for this message
Tres Seaver (tseaver) wrote :

Thanks for tracking this down! Fix committed with tests to the
2.10 branch, the 2.11 branch, and the trunk:

- http://svn.zope.org/Zope/branches/2.10/?rev=93506&view=rev

- http://svn.zope.org/Zope/branches/2.11/?rev=93507&view=rev

- http://svn.zope.org/Zope/trunk/?rev=93508&view=rev

Changed in zope2:
assignee: nobody → tseaver
status: Confirmed → Fix Committed
Changed in zope2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.