From 8d00d7c13038abc152afbd46c96108753506fb77 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 23 May 2012 11:00:24 -0400 Subject: Enforce sizelimit in permission-find, post_callback returns truncated We actually perform two searches in permission-find. The first looks for matches within the permission object itself. The second looks at matches in the underlying aci. We need to break out in two places. The first is if we find enough matches in the permission itself. The second when we are appending matches from acis. The post_callback() definition needed to be modified to return the truncated value so a plugin author can modify that value. https://fedorahosted.org/freeipa/ticket/2322 --- ipalib/plugins/baseldap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ipalib/plugins/baseldap.py') diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 58d53fd0..93852a2d 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -1857,9 +1857,9 @@ class LDAPSearch(BaseLDAPCommand, crud.Search): for callback in self.POST_CALLBACKS: if hasattr(callback, 'im_self'): - callback(ldap, entries, truncated, *args, **options) + truncated = callback(ldap, entries, truncated, *args, **options) else: - callback(self, ldap, entries, truncated, *args, **options) + truncated = callback(self, ldap, entries, truncated, *args, **options) if self.sort_result_entries: if self.obj.primary_key: @@ -1884,7 +1884,7 @@ class LDAPSearch(BaseLDAPCommand, crud.Search): return (filters, base_dn, scope) def post_callback(self, ldap, entries, truncated, *args, **options): - pass + return truncated def exc_callback(self, args, options, exc, call_func, *call_args, **call_kwargs): raise exc -- cgit