summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorMartin Kosek <mkosek@redhat.com>2012-02-22 13:41:23 +0100
committerRob Crittenden <rcritten@redhat.com>2012-03-01 21:50:52 -0500
commiteeee8e1c6e01a36916bec3eed9212742e089c5b8 (patch)
tree47e3a4e3d1530993a0f5ccbc2f72c049b61e98f5 /ipalib/plugins/baseldap.py
parentd55d8bfa7ed1d3617274c9f53974e7bf5209cc4e (diff)
downloadfreeipa.git-eeee8e1c6e01a36916bec3eed9212742e089c5b8.tar.gz
freeipa.git-eeee8e1c6e01a36916bec3eed9212742e089c5b8.tar.xz
freeipa.git-eeee8e1c6e01a36916bec3eed9212742e089c5b8.zip
Fix encoding for setattr/addattr/delattr
Attribute values passed by --{set,add,del}attr parameters were normalized and validated using appropriate parameter, but were never encoded for the backend. This make prevents manipulation with dirsvr BOOL attributes where framework tries to pass boolean value instead of encoded "TRUE"/"FALSE" values. https://fedorahosted.org/freeipa/ticket/2418
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 2664160f..c0f25479 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -782,6 +782,8 @@ last, after all sets and adds."""),
except errors.ValidationError, err:
(name, error) = str(err.strerror).split(':')
raise errors.ValidationError(name=attr, error=error)
+ if self.api.env.in_server:
+ value = self.params[attr].encode(value)
if append and attr in newdict:
if type(value) in (tuple,):
newdict[attr] += list(value)