From 49333058c869dd4bd654a7974e6e144ffd3f0dc3 Mon Sep 17 00:00:00 2001 From: Martin Basti Date: Fri, 13 Jan 2017 12:37:47 +0100 Subject: [PATCH] py3: get_effective_rights: values passed to ldap must be bytes Values passed to LDAP must be bytes https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Christian Heimes --- ipaserver/plugins/ldap2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py index 25fbfb816..c4b7580d2 100644 --- a/ipaserver/plugins/ldap2.py +++ b/ipaserver/plugins/ldap2.py @@ -289,7 +289,10 @@ class ldap2(CrudBackend, LDAPClient): principal = getattr(context, 'principal') entry = self.find_entry_by_attr("krbprincipalname", principal, "krbPrincipalAux", base_dn=self.api.env.basedn) - sctrl = [GetEffectiveRightsControl(True, "dn: " + str(entry.dn))] + sctrl = [ + GetEffectiveRightsControl( + True, "dn: {0}".format(entry.dn).encode('utf-8')) + ] self.conn.set_option(_ldap.OPT_SERVER_CONTROLS, sctrl) try: entry = self.get_entry(dn, attrs_list)