From a77627dd8cca43bd1131a7e186de0ab159763761 Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: Dec 07 2016 12:01:58 +0000 Subject: Fix permission-find with sizelimit set If permission-find is fired with an argument and sizelimit set a message about truncation will be sent along with the result as the search in post_callback() does general search instead of having its filter properly set. https://fedorahosted.org/freeipa/ticket/5640 Reviewed-By: Martin Basti --- diff --git a/ipaserver/plugins/permission.py b/ipaserver/plugins/permission.py index 0bd75b0..dd2a018 100644 --- a/ipaserver/plugins/permission.py +++ b/ipaserver/plugins/permission.py @@ -1306,6 +1306,13 @@ class permission_find(baseldap.LDAPSearch): filters.append(ldap.make_filter_from_attr('cn', options['name'], exact=False)) + index = tuple(self.args).index('criteria') + try: + term = args[index] + filters.append(self.get_term_filter(ldap, term)) + except IndexError: + term = None + attrs_list = list(self.obj.default_attributes) attrs_list += list(self.obj.attribute_members) if options.get('all'):