SVN: r21083 - trunk/quixote
Andrew Kuchling <akuchlin-fVcApmY9cLvQ3/1i3zOLAti2O/[email protected]> Wed, 12 Mar 2003 12:40:14 -0500
| Newsgroups | gmane.comp.web.quixote.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: akuchlin
Date: 2003-03-12 12:40:14 -0500 (Wed, 12 Mar 2003)
New Revision: 21083
Modified:
trunk/quixote/publish.py
Log:
If _q_index isn't in the current namespace, raise an AccessError (which will be
mapped to an HTTP 403 Forbidden)
Whitespace n11n
(Minor side effects of this change: _q_index will not be passed to _q_resolve,
nor will a _q_index.{py,ptl} module be imported. I don't expect this to be
a problem.)
Modified: trunk/quixote/publish.py
==============================================================================
--- trunk/quixote/publish.py (original)
+++ trunk/quixote/publish.py 2003-03-12 12:40:14.000000000 -0500
@@ -456,7 +456,7 @@
# raised.
if (component != "_q_index" and component not in container._q_exports):
- # Component is not in exports list.
+ # Component is not in exports list.
object = None
if hasattr(container, "_q_getname"):
object = container._q_getname(request, component)
@@ -472,6 +472,10 @@
# attribute is in _q_exports and exists
object = getattr(container, component)
+ elif component == '_q_index':
+ raise errors.AccessError(
+ private_msg=("_q_index not found in %r" % container))
+
elif hasattr(container, "_q_resolve"):
object = container._q_resolve(component)
if object is None:
@@ -505,7 +509,7 @@
"""get_namespace_stack() -> [ module | instance | class ]
"""
return self.namespace_stack
-
+
_slash_pat = re.compile("//*")
def traverse_url (self, path, request):