Description of problem: LDAP reports an error "Server does not support sorting", if no entries present in the Suffix DN. How reproducible: Consistently Steps to Reproduce: 1. Run a simple paged search for a suffix which doesn't have any entry or give a filter which doesn't match any of entry in the DN. 2. Observe the output of the paged search. 3. It shows "Server does not support sorting". Expected results: Error message is misleading as Sorting is not implemented.
Problem description: It's a bug in server side sorting. If the search result candidate is NULL, sort control is not created. ldapsearch -b "dc=test,dc=com" -x -S "cn" "(cn=*)" dn ldap_parse_sort_control: Requested LDAP control not found
Created attachment 354770 [details] git patch file for ldbm_search.c File: ldap/servers/slapd/back-ldbm/ldbm_search.c Fix description: When sort request control is given, even if the search result is NULL, sort response control should be created and passed to the client. This change fixes it.
Reviewed by Rich (Thank you!!) Pushed to master. $ git merge paged Updating fa2fd42..35a54ff Fast forward ldap/servers/slapd/back-ldbm/ldbm_search.c | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) $ git push Counting objects: 13, done. Compressing objects: 100% (7/7), done. Writing objects: 100% (7/7), 891 bytes, done. Total 7 (delta 5), reused 0 (delta 0) To ssh://git.fedorahosted.org/git/389/ds.git fa2fd42..35a54ff master -> master
verified - RHEL 4 version: 1. No users in subtree searched: ldapsearch -x -h hostname.example.com -p 389 -D "cn=Directory Manager" -w Secret -b "ou=Special Users,dc=example,dc=com" # extended LDIF # # LDAPv3 # base <ou=Special Users,dc=example,dc=com> with scope sub # filter: (objectclass=*) # requesting: ALL # # Special Users, example.com dn: ou=Special Users,dc=example,dc=com objectClass: top objectClass: organizationalUnit ou: Special Users description: Special Administrative Accounts # search result search: 2 result: 0 Success # numResponses: 2 #perl ./ldapsearch.pl -x -pg 4 "(uid=*)" "dn sn" # echo $? 0 Returns no error