summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorStanislav Laznicka <slaznick@redhat.com>2016-12-07 11:53:31 +0100
committerMartin Basti <mbasti@redhat.com>2016-12-07 13:01:58 +0100
commita77627dd8cca43bd1131a7e186de0ab159763761 (patch)
tree2b6cecadb6c70131b1a7d43e7f409e55087bd4c1 /ipaserver/plugins
parent0c044cb084780ee45860169dd5d12689cf05fa49 (diff)
downloadfreeipa-a77627dd8cca43bd1131a7e186de0ab159763761.tar.gz
freeipa-a77627dd8cca43bd1131a7e186de0ab159763761.tar.xz
freeipa-a77627dd8cca43bd1131a7e186de0ab159763761.zip
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>
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/permission.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ipaserver/plugins/permission.py b/ipaserver/plugins/permission.py
index 0bd75b09f..dd2a0183e 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'):