mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
parent
d55d8bfa7e
commit
eeee8e1c6e
@ -782,6 +782,8 @@ last, after all sets and adds."""),
|
|||||||
except errors.ValidationError, err:
|
except errors.ValidationError, err:
|
||||||
(name, error) = str(err.strerror).split(':')
|
(name, error) = str(err.strerror).split(':')
|
||||||
raise errors.ValidationError(name=attr, error=error)
|
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 append and attr in newdict:
|
||||||
if type(value) in (tuple,):
|
if type(value) in (tuple,):
|
||||||
newdict[attr] += list(value)
|
newdict[attr] += list(value)
|
||||||
|
Loading…
Reference in New Issue
Block a user