diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2009-07-22 11:34:23 -0700 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2009-07-22 11:34:23 -0700 |
commit | 35a54ffef5819e7d0cebadcba03b32c2cf918d8d (patch) | |
tree | 9e4d31ec2ef9942bb642e4d38b77856e600ba86c /ldap/servers | |
parent | fa2fd420737603164e096473949bf1ed42ca6f21 (diff) | |
download | ds-35a54ffef5819e7d0cebadcba03b32c2cf918d8d.tar.gz ds-35a54ffef5819e7d0cebadcba03b32c2cf918d8d.tar.xz ds-35a54ffef5819e7d0cebadcba03b32c2cf918d8d.zip |
513170 NULL search result does not return sort control
When sort request control is given, even if the search result is NULL,
sort response control should be created and passed to the client.
Diffstat (limited to 'ldap/servers')
-rw-r--r-- | ldap/servers/slapd/back-ldbm/ldbm_search.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c index 8324d94f..1c859c73 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_search.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c @@ -491,8 +491,23 @@ ldbm_back_search( Slapi_PBlock *pb ) /* * Client wants the server to sort the results. */ - if (sort && (NULL != candidates)) + if (sort) { + if (NULL == candidates) + { + /* Even if candidates is NULL, we have to return a sort + * response control with the LDAP_SUCCESS return code. */ + if (LDAP_SUCCESS != + sort_make_sort_response_control( pb, LDAP_SUCCESS, NULL )) + { + return ldbm_back_search_cleanup(pb, li, sort_control, + (abandoned?-1:LDAP_PROTOCOL_ERROR), + "Sort Response Control", -1, + &basesdn, &vlv_request_control); + } + } + else + { /* Before we haste off to sort the candidates, we need to * prepare some information for the purpose of imposing the * administrative limits. @@ -574,6 +589,7 @@ ldbm_back_search( Slapi_PBlock *pb ) "Sort Response Control", -1, &basesdn, &vlv_request_control); } + } } /* * If we're presenting a virtual list view, then the candidate list |