summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-01-13 12:37:47 +0100
committerMartin Basti <mbasti@redhat.com>2017-01-31 18:33:27 +0100
commit49333058c869dd4bd654a7974e6e144ffd3f0dc3 (patch)
treedc87011378292df9ce5fac04fdf0471d966779f2 /ipaserver
parentdd3d9f1ca61946ea5d7daa17ba1d8a883922d526 (diff)
downloadfreeipa-49333058c869dd4bd654a7974e6e144ffd3f0dc3.tar.gz
freeipa-49333058c869dd4bd654a7974e6e144ffd3f0dc3.tar.xz
freeipa-49333058c869dd4bd654a7974e6e144ffd3f0dc3.zip
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 <cheimes@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/plugins/ldap2.py5
1 files changed, 4 insertions, 1 deletions
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)