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 <mbasti@redhat.com>
This commit is contained in:
Stanislav Laznicka authored and Martin Basti committed 2016-12-07 13:01:58 +01:00
1 parent 0c044cb084
commit a77627dd8c
1 file changed
+7
+7
View File
@@ -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'):