summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-05-10 11:03:41 -0400
committerMartin Kosek <mkosek@redhat.com>2012-05-15 10:02:26 +0200
commitece68f381a1bcf38d2f9c2d1b7f960438d5e2241 (patch)
treec776ec94026a3bc33f9ca58d81cebabf553205b3 /ipalib/plugins
parent26ab9a504f504f59cfd3af929dbeac2ddc201ed3 (diff)
downloadfreeipa-ece68f381a1bcf38d2f9c2d1b7f960438d5e2241.tar.gz
freeipa-ece68f381a1bcf38d2f9c2d1b7f960438d5e2241.tar.xz
freeipa-ece68f381a1bcf38d2f9c2d1b7f960438d5e2241.zip
Check for empty/single value parameters before calling callbacks
https://fedorahosted.org/freeipa/ticket/2701
Diffstat (limited to 'ipalib/plugins')
-rw-r--r--ipalib/plugins/baseldap.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 895ec682a..2851f0f27 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -1255,6 +1255,9 @@ class LDAPUpdate(LDAPQuery, crud.Update):
set(self.obj.default_attributes + entry_attrs.keys())
)
+ _check_single_value_attrs(self.params, entry_attrs)
+ _check_empty_attrs(self.obj.params, entry_attrs)
+
for callback in self.PRE_CALLBACKS:
if hasattr(callback, 'im_self'):
dn = callback(
@@ -1265,8 +1268,6 @@ class LDAPUpdate(LDAPQuery, crud.Update):
self, ldap, dn, entry_attrs, attrs_list, *keys, **options
)
- _check_single_value_attrs(self.params, entry_attrs)
- _check_empty_attrs(self.obj.params, entry_attrs)
ldap.get_schema()
_check_limit_object_class(self.api.Backend.ldap2.schema.attribute_types(self.obj.limit_object_classes), entry_attrs.keys(), allow_only=True)
_check_limit_object_class(self.api.Backend.ldap2.schema.attribute_types(self.obj.disallow_object_classes), entry_attrs.keys(), allow_only=False)