From ece68f381a1bcf38d2f9c2d1b7f960438d5e2241 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 10 May 2012 11:03:41 -0400 Subject: Check for empty/single value parameters before calling callbacks https://fedorahosted.org/freeipa/ticket/2701 --- ipalib/plugins/baseldap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ipalib/plugins/baseldap.py') diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 895ec682..2851f0f2 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) -- cgit