Description of problem:
LDAP_SIZE_LIMIT_EXCEEDED error is not returned if the page size greater than the nsslapd-sizelimit.
How reproducible: Consistently
Steps to Reproduce:
1. Set nsslapd-sizelimit to 20.
2. Create 100 entries
3. Run a simple paged search which would return all the 100 entries.
Actual results: Search succeeds without any problem.
Expected results: Search should return an error, LDAP_SIZE_LIMIT_EXCEEDED.
Created attachment 354796 [details]
git patch file for back-ldbm.h and ldbm_search.c
Simple Paged Results returns one page in one operation. Sizelimit was reset at the beginning of each opeartion.
search_result_set is stashed and each page is retrieved from the same search_result_set. Thus, let search_result_set keep the current sizelimit and use the value for checking the limit. The value is valid both in one operation and multiple operations using one search_result_set.
Reviewed by Rich (Thank you!!)
Pushed to master.
$ git merge paged
ldap/servers/slapd/back-ldbm/back-ldbm.h | 3 ++-
ldap/servers/slapd/back-ldbm/ldbm_search.c | 22 ++++++++++++++++------
2 files changed, 18 insertions(+), 7 deletions(-)
$ git push
Counting objects: 15, done.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (8/8), 1.15 KiB, done.
Total 8 (delta 6), reused 0 (delta 0)
35a54ff..c3f6ff6 master -> master
1. added lots of users
2. set nssldapd-sizelimit to 20
# ldapsearch -x -h `hostname` -p 389 -D "cn=Directory Manager" -w Secret123 -b "cn=config" | grep sizelimit
3. run paged search with page size of 100
next page size (100):
Am I missing something? I should be getting LDAP_SIZE_LIMIT_EXCEEDED correct?
I think limits do not apply to Directory Manager - try a normal user.
Yup - verified - RHEL 4
earch failed: LDAP_SIZELIMIT_EXCEEDED: The maximum number of search results to return has been exceeded.