[Zope-dev] Re: 2.7 assertion with CVS of this morning

2004-01-13 Thread Tres Seaver
robert wrote:
I refreshed my 2.7 from CVS this morning (7.30 MEZ) and get the following 
traceback:
This is my bad, I'm pretty sure.  Was this just trying to get into the 
ZMI, or was there another application / template which triggered the 
problem?  At any rate, the fix is likely to be to add 'guarded_hasattr' 
to the list of items which should be wrapped;  on the 2.7 branch, this 
list is at the bottom of AccessControl.Implementation.

Robert

Site Error
An error was encountered while publishing this resource.

TypeError
Sorry, a site error occurred.
Traceback (innermost last):

* Module ZPublisher.Publish, line 163, in publish_module_standard
* Module Products.PlacelessTranslationService.PatchStringIO, line 45, in 
new_publish
* Module ZPublisher.Publish, line 127, in publish
* Module Zope.App.startup, line 203, in zpublisher_exception_hook
* Module ZPublisher.Publish, line 100, in publish
* Module ZPublisher.mapply, line 88, in mapply
* Module ZPublisher.Publish, line 40, in call_object
* Module Shared.DC.Scripts.Bindings, line 261, in __call__
* Module Shared.DC.Scripts.Bindings, line 292, in _bindAndExec
* Module App.special_dtml, line 175, in _exec
* Module DocumentTemplate.DT_Let, line 75, in render
* Module DocumentTemplate.DT_Util, line 201, in eval
  __traceback_info__: _
* Module string, line 0, in ?

TypeError: guarded_hasattr() takes exactly 2 arguments (3 given) (Also, an 
error occurred while attempting to render the standard error message.)
Tres.
--
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  Zope Dealers   http://www.zope.com
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: 2.7 assertion with CVS of this morning

2004-01-13 Thread Yuppie
robert wrote:
I grepped for has_order_support to find out where this happens, but did not 
find it.
The Zope 2.7 main.dtml has this code:

_.hasattr(this().aq_self, 'has_order_support')

HTH, Yuppie



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: 2.7 assertion with CVS of this morning

2004-01-13 Thread Yuppie
Tres Seaver wrote:
This is my bad, I'm pretty sure.  Was this just trying to get into the 
ZMI, or was there another application / template which triggered the 
problem?  At any rate, the fix is likely to be to add 'guarded_hasattr' 
to the list of items which should be wrapped;  on the 2.7 branch, this 
list is at the bottom of AccessControl.Implementation.
Yes. Adding 'hasattr' (the key for guarded_hasattr) to _NEED_WRAPPING 
seems to fix this issue.

Cheers,
Yuppie


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] _.min and _.max still used by ZMI

2004-01-13 Thread Travis Miller
hi Dirk,

i just (configure/make/make install)ed Zope-2.7.0-b4 and i immediately 
ran into the .min/.max/... security changes when i tried to rename an 
object through the ZMI.

i tried your patch but after the change, zopectl errors when run:

[EMAIL PROTECTED]:~ ./InstanceHome27b4/bin/zopectl start
Error: The object named by DBTab.ClassFactories.autoClassFactory 
could not be imported
(line 822 in file:///opt/Zope/InstanceHome27b4-2/etc/zope.conf)
For help, use 
/opt/Zope/SoftwareHome27b4/lib/python/Zope/Startup/zopectl.py -h

when i rollback the patch zopectl runs again, but ofcourse the max call 
still fails.

any ideas?

thanks,
travis
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] _.min and _.max still used by ZMI

2004-01-13 Thread Roger Espinosa
On Tuesday, January 13, 2004, at 11:21  PM, Travis Miller wrote:

hi Dirk,

i just (configure/make/make install)ed Zope-2.7.0-b4 and i immediately 
ran into the .min/.max/... security changes when i tried to rename an 
object through the ZMI.
I got around the min/max by adding them to the list on 
RestrictedPython/Guards.py.

But b4 seemed to make any script trying to pass a zero-value parameter 
raise unauthorized exceptions. Code like

	ob.edit( is_exemplar=0 )

non longer worked. Traceback from another attempt attached below, when 
notify_instantly was set to 0. (Passing an integer 1 *would* work.)

Roger

Traceback (most recent call last):
  File /usr/local/zope/App/lib/python/ZPublisher/Publish.py, line 
100, in publ
ish
request, bind=1)
  File /usr/local/zope/App/lib/python/ZPublisher/mapply.py, line 88, 
in mapply
if debug is not None: return debug(object,args,context)
  File /usr/local/zope/App/lib/python/ZPublisher/Publish.py, line 40, 
in call_
object
result=apply(object,args) # Type scr to step into published 
object.
  File 
/usr/local/zope/App/lib/python/Products/CMFCore/FSPythonScript.py, 
line
 92, in __call__
return Script.__call__(self, *args, **kw)
  File /usr/local/zope/App/lib/python/Shared/DC/Scripts/Bindings.py, 
line 261,
 in __call__
return self._bindAndExec(args, kw, None)
  File /usr/local/zope/App/lib/python/Shared/DC/Scripts/Bindings.py, 
line 292,
 in _bindAndExec
return self._exec(bound_data, args, kw)
  File 
/usr/local/zope/App/lib/python/Products/CMFCore/FSPythonScript.py, 
line
 126, in _exec
result = apply(f, args, kw)
  File Script (Python), line 55, in post_feedback
  File /usr/local/zope/App/lib/python/AccessControl/ZopeGuards.py, 
line 349, i
n guarded_apply
return builtin_guarded_apply(func, args, kws)
  File /usr/local/zope/App/lib/python/AccessControl/ZopeGuards.py, 
line 371, i
n builtin_guarded_apply
return func(*arglist, **argdict)
  File 
/usr/local/zope/App/lib/python/Products/CMFCore/PortalFolder.py, line 
3
62, in invokeFactory
, kw
  File /usr/local/zope/App/lib/python/Products/CMFCore/TypesTool.py, 
line 824,
 in constructContent
ob = apply(info.constructInstance, (container, id) + args, kw)
  File /usr/local/zope/App/lib/python/Products/CMFCore/TypesTool.py, 
line 513,
 in constructInstance
id = apply( m, args, kw ) or id  # allow factory to munge ID
  File /usr/local/zope/M2K3/Products/Mousetrap/FeedbackPost.py, line 
84, in ad
dFeedbackPost
o.setupFeedbackType(defaults=kw)
  File /usr/local/zope/M2K3/Products/Mousetrap/FeedbackPost.py, line 
124, in s
etupFeedbackType
method(defaults=defaults)
  File 
/usr/local/zope/App/lib/python/Products/CMFCore/FSPythonScript.py, 
line
 92, in __call__
return Script.__call__(self, *args, **kw)
  File /usr/local/zope/App/lib/python/Shared/DC/Scripts/Bindings.py, 
line 261,
 in __call__
return self._bindAndExec(args, kw, None)
  File /usr/local/zope/App/lib/python/Shared/DC/Scripts/Bindings.py, 
line 292,
 in _bindAndExec
return self._exec(bound_data, args, kw)
  File 
/usr/local/zope/App/lib/python/Products/CMFCore/FSPythonScript.py, 
line
 126, in _exec
result = apply(f, args, kw)
  File Script (Python), line 5, in apply_CommentSchema
  File /usr/local/zope/App/lib/python/AccessControl/ZopeGuards.py, 
line 349, i
n guarded_apply
return builtin_guarded_apply(func, args, kws)
  File /usr/local/zope/App/lib/python/AccessControl/ZopeGuards.py, 
line 369, i
n builtin_guarded_apply
guard(kws, v, k)
  File /usr/local/zope/App/lib/python/AccessControl/ZopeGuards.py, 
line 219, i
n guard
if getSecurityManager().validate(container, container, index, 
value):
  File /usr/local/zope/App/lib/python/AccessControl/ImplPython.py, 
line 263, i
n validate
raise Unauthorized(name, value)
Unauthorized: You are not allowed to access 'notify_instantly' in this 
context

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: 2.7 assertion with CVS of this morning

2004-01-13 Thread robert
I found this,
however 'has_order_support' is not the third argument.
That is why I do not unterstand what happens.
Robert

On Tuesday 13 January 2004 23:58, Yuppie wrote:
 robert wrote:
  I grepped for has_order_support to find out where this happens, but did
  not find it.

 The Zope 2.7 main.dtml has this code:

 _.hasattr(this().aq_self, 'has_order_support')


 HTH, Yuppie



 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )