Changeset 886


Ignore:
Timestamp:
07/24/06 17:30:42 (7 years ago)
Author:
mglb1
Message:

Fix bugs in mac address -> username conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccsd/trunk/crcnetd/_utils/ccsd_server.py

    r885 r886  
    350350        """ 
    351351        from ccsd_session import getSessionE, startSession, startBasicSession 
    352  
    353         allow_login = config_getboolean(None, "cert_logins", True) 
    354         if not allow_login: 
    355             return startBasicSession(subj.CN, SESSION_RW) 
    356  
     352         
    357353        # Check incoming peer certificate 
    358354        cert = request.channel.transport.socket.get_peer_certificate() 
    359355        subj = cert.get_subject() 
     356        username = subj.CN.replace(":", "") 
     357 
     358        allow_login = config_getboolean(None, "cert_logins", True) 
     359        if not allow_login: 
     360            # CN matches a MAC address 
     361            return startBasicSession(username, SESSION_RW) 
    360362         
    361363        # Does the CN match a username? 
     
    369371             
    370372        # CN matches a MAC address 
    371         username = subj.CN.strip(":") 
    372373        return startBasicSession(username, SESSION_RW) 
    373374 
Note: See TracChangeset for help on using the changeset viewer.