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

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


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

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

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===================================================================
--- Zope/branches/2.9/doc/CHANGES.txt	2007-09-01 14:35:08 UTC (rev 79424)
+++ Zope/branches/2.9/doc/CHANGES.txt	2007-09-01 14:35:47 UTC (rev 79425)
@@ -8,6 +8,8 @@
 
    Bugs fixed
 
+      - Collector #2346: username logging in FCGI crashed the server
+
       - Collector #2332: SessionDataManger: don't swallow ConflictErrors
 
 

Modified: Zope/branches/2.9/lib/python/ZServer/FCGIServer.py
===================================================================
--- Zope/branches/2.9/lib/python/ZServer/FCGIServer.py	2007-09-01 14:35:08 UTC (rev 79424)
+++ Zope/branches/2.9/lib/python/ZServer/FCGIServer.py	2007-09-01 14:35:47 UTC (rev 79425)
@@ -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