[Zope-Checkins] SVN: Zope/branches/2.10/ - Collector #2346: username logging in FCGI crashed the server

Andreas Jung andreas at andreas-jung.com
Sat Sep 1 10:35:09 EDT 2007


Log message for revision 79424:
  
        - Collector #2346: username logging in FCGI crashed the server
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/ZServer/FCGIServer.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.10/doc/CHANGES.txt	2007-09-01 14:34:29 UTC (rev 79423)
+++ Zope/branches/2.10/doc/CHANGES.txt	2007-09-01 14:35:08 UTC (rev 79424)
@@ -8,6 +8,8 @@
 
     Bugs fixed
 
+      - Collector #2346: username logging in FCGI crashed the server
+
       - ZopePageTemplate's pt_edit did not recognize content type arguments
         which had a charset information included.
 

Modified: Zope/branches/2.10/lib/python/ZServer/FCGIServer.py
===================================================================
--- Zope/branches/2.10/lib/python/ZServer/FCGIServer.py	2007-09-01 14:34:29 UTC (rev 79423)
+++ Zope/branches/2.10/lib/python/ZServer/FCGIServer.py	2007-09-01 14:35:08 UTC (rev 79424)
@@ -456,18 +456,15 @@
             method=self.env['REQUEST_METHOD']
         else:
             method="GET"
+        user_name = '-'
         if self.env.has_key('HTTP_AUTHORIZATION'):
             http_authorization=self.env['HTTP_AUTHORIZATION']
             if string.lower(http_authorization[:6]) == 'basic ':
                 try: decoded=base64.decodestring(http_authorization[6:])
                 except base64.binascii.Error: decoded=''
                 t = string.split(decoded, ':', 1)
-                if len(t) < 2:
-                    user_name = '-'
-                else:
+                if len(t) >= 2:
                     user_name = t[0]
-        else:
-            user_name='-'
         if self.addr:
             self.server.logger.log (
                 self.addr[0],



More information about the Zope-Checkins mailing list