Bug 513170

Summary: Simple paged with sorting gives error message as "Server does not support sorting".
Product: Red Hat Directory Server Reporter: Sankar Ramalingam <sramling>
Component: Directory ServerAssignee: Noriko Hosoi <nhosoi>
Status: CLOSED CURRENTRELEASE QA Contact: Viktor Ashirov <vashirov>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: jgalipea, rmeggins
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-06 14:38:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 434914, 517385    
Attachments:
Description Flags
git patch file for ldbm_search.c none

Description Sankar Ramalingam 2009-07-22 12:02:52 UTC
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.

Comment 1 Noriko Hosoi 2009-07-22 18:33:20 UTC
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

Comment 2 Noriko Hosoi 2009-07-22 18:40:20 UTC
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.

Comment 3 Noriko Hosoi 2009-07-22 18:53:12 UTC
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

Comment 4 Jenny Severance 2010-05-17 19:25:44 UTC
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