Changeset 3497 for pykota/trunk

Show
Ignore:
Timestamp:
04/08/09 12:10:55 (15 years ago)
Author:
jerome
Message:

Improvement over the latest fix. References #41.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/cups.py

    r3496 r3497  
    8080        # handle Kerberized usernames as described here : 
    8181        # http://www.mit.edu/~kerberos/krb5-1.5/krb5-1.5.4/doc/krb5-user/What-is-a-Kerberos-Principal_003f.html 
    82         self.OriginatingUserName = self.OriginatingUserName.split("@", 1)[0].split("/")[0] 
     82        # 
     83        # Only does this if there's a "@" in the username, otherwise we could break non-kerberized 
     84        # usernames containing a "/", like Samba/Windows usernames in some cases. 
     85        if self.OriginatingUserName.find("@") != -1 : 
     86            self.OriginatingUserName = self.OriginatingUserName.split("@", 1)[0].split("/")[0] 
    8387 
    8488        for attrib in ("OriginatingUserName",