dbnicholson / ipsilon

Forked from ipsilon 5 years ago
Clone

c78dbaa info: infoldap: Decode values to unicode if possible

Authored and Committed by dbnicholson 4 years ago
    info: infoldap: Decode values to unicode if possible
    
    python-ldap doesn't know the LDAP schema, so all attribute values are
    returned in binary since the value could be anything. However, ipsilon
    expects that all info data is in string format. Try to convert the value
    to unicode, maintaining the original binary value if the decoding fails.
    
    With python2, things worked OK as long as the values were ASCII. For
    python3, attribute values will be passed around as bytes, which will
    definitely do the wrong thing.
    
    Signed-off-by: Dan Nicholson <nicholson@endlessm.com>
    
        
file modified
+20 -2