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

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

-=-
Modified: Zope/trunk/doc/CHANGES.txt
===================================================================
--- Zope/trunk/doc/CHANGES.txt  2007-09-01 13:48:10 UTC (rev 79422)
+++ Zope/trunk/doc/CHANGES.txt  2007-09-01 14:34:29 UTC (rev 79423)
@@ -149,6 +149,8 @@
 
     Bugs Fixed
 
+      - Collector #2346: username logging in FCGI crashed the server
+
       - Collector #2339: ZPT: fixed unicode issue when using the 'structure'
         directive
 

Modified: Zope/trunk/lib/python/ZServer/FCGIServer.py
===================================================================
--- Zope/trunk/lib/python/ZServer/FCGIServer.py 2007-09-01 13:48:10 UTC (rev 
79422)
+++ Zope/trunk/lib/python/ZServer/FCGIServer.py 2007-09-01 14:34:29 UTC (rev 
79423)
@@ -455,18 +455,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],

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to