summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins/baseldap.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-01-24 17:49:06 +0100
committerJan Cholasta <jcholast@redhat.com>2017-02-08 08:32:44 +0100
commitcaa560ca79e4038b161b27d11e3f144606dbbcdb (patch)
treed3b4b053061170ffa182be3f1e012e56899eac78 /ipaserver/plugins/baseldap.py
parent8e139d4b559a6f19d859e078e1940a69d8977fdb (diff)
downloadfreeipa-caa560ca79e4038b161b27d11e3f144606dbbcdb.tar.gz
freeipa-caa560ca79e4038b161b27d11e3f144606dbbcdb.tar.xz
freeipa-caa560ca79e4038b161b27d11e3f144606dbbcdb.zip
py3: base64 encoding/decoding returns always bytes don't mix it
Using unicode(bytes) call causes undesired side effect that is inserting `b` character to result. This obviously causes issues with binary base64 data https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver/plugins/baseldap.py')
-rw-r--r--ipaserver/plugins/baseldap.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipaserver/plugins/baseldap.py b/ipaserver/plugins/baseldap.py
index e7bf43cad..24b6db7c0 100644
--- a/ipaserver/plugins/baseldap.py
+++ b/ipaserver/plugins/baseldap.py
@@ -1036,7 +1036,7 @@ last, after all sets and adds."""),
except ValueError:
if isinstance(delval, bytes):
# This is a Binary value, base64 encode it
- delval = unicode(base64.b64encode(delval))
+ delval = base64.b64encode(delval).decode('ascii')
raise errors.AttrValueNotFound(attr=attr, value=delval)
# normalize all values