SVN: soap/trunk/publisher.py make sure Unauthorized is handled in all cases; some usages could leak through

"Fred L. Drake, Jr." <[email protected]>
Newsgroups gmane.comp.web.zope.public-cvs
Message-ID <[email protected]>
Log message for revision 30032:
  make sure Unauthorized is handled in all cases; some usages could leak through

Changed:
  U   soap/trunk/publisher.py

-=-
Modified: soap/trunk/publisher.py
===================================================================
--- soap/trunk/publisher.py	2005-04-18 20:32:54 UTC (rev 30031)
+++ soap/trunk/publisher.py	2005-04-18 20:51:52 UTC (rev 30032)
@@ -24,6 +24,7 @@
 from ZSI import TC, ParsedSoap, ParseException
 from ZSI import SoapWriter, Fault
 from zope.security.proxy import isinstance
+from zope.security.interfaces import IUnauthorized
 from zope.publisher.xmlrpc import premarshal
 from zope.interface import implements
 from StringIO import StringIO
@@ -172,6 +173,11 @@
     def handleException(self, exc_info):
         """Handle exceptions that occur during processing."""
         type, value = exc_info[:2]
+        if IUnauthorized.providedBy(value):
+            self.setStatus(401)
+            self._body = ""
+            self._updateContentLength()
+            return
         if not isinstance(value, Fault):
             value = ZSI.FaultFromException(value, 0)
         self.setStatus(500)

_______________________________________________
Zope-CVS maillist  -  [email protected]
http://mail.zope.org/mailman/listinfo/zope-cvs

Zope CVS instructions: http://dev.zope.org/CVS
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.