Comment 2 for bug 1375139

Revision history for this message
Robert Plestenjak (robert-plestenjak) wrote :

Icehouse 2014.1.2

I have narrow it down to function 'def is_dn_equal(dn1, dn2):' in 'site-packages/keystone/common/ldap/core.py'.

Keystone does utf8_decode on everything it reads from LDAP, but it doesn't utf8_encode LDAP calls.

Fails when it encounters non ascii:

    if not isinstance(dn1, list):
        dn1 = ldap.dn.str2dn(dn1)
    if not isinstance(dn2, list):
        dn2 = ldap.dn.str2dn(dn2)

Works even with non ascii characters (proposed fix):

    if not isinstance(dn1, list):
        dn1 = ldap.dn.str2dn(utf8_encode(dn1))
    if not isinstance(dn2, list):
        dn2 = ldap.dn.str2dn(utf8_encode(dn2))