summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2007-10-03 17:44:50 +0000
committerRich Megginson <rmeggins@redhat.com>2007-10-03 17:44:50 +0000
commitf6aa853daf016616a76b490c8d22645dbf98855e (patch)
tree9eefc15fad0be9861c40e8c38d8e64851061e40f
parent464b3225941e849b4283134278c76c537adc62ca (diff)
downloadds-f6aa853daf016616a76b490c8d22645dbf98855e.tar.gz
ds-f6aa853daf016616a76b490c8d22645dbf98855e.tar.xz
ds-f6aa853daf016616a76b490c8d22645dbf98855e.zip
Resolves: bug 282911
Description: double err=32 result sent when suffix doesn't exist Reviewed by: nkinder (Thanks!) Fix Description: The backend does not send back a result if the op is search and the err is NO_SUCH_OBJECT (32). The frontend should handle this case so that it knows to defer sending the result until all of the backend candidates have been scanned. We also need to change send_nobackend_ldap_result() to use slapi_send_ldap_result instead of send_ldap_result so that it has the same semantics as the regular backend code. Platforms tested: RHEL5 x86_64
-rw-r--r--ldap/servers/slapd/opshared.c18
-rw-r--r--ldap/servers/slapd/result.c2
2 files changed, 16 insertions, 4 deletions
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index abae06bb..85c45666 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -546,10 +546,22 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
rc = (*be->be_search)(pb);
switch (rc)
{
- int err;
- case 1: /* backend successfully sent result to the client */
+ int err = 0;
+ case 1: /* if the backend returned LDAP_NO_SUCH_OBJECT for a SEARCH request,
+ it will not have sent back a result - otherwise, it will have
+ sent a result */
rc = SLAPI_FAIL_GENERAL;
- /* Set a flag here so we don't return another result. */
+ slapi_pblock_get(pb, SLAPI_RESULT_CODE, &err);
+ if (err == LDAP_NO_SUCH_OBJECT)
+ {
+ /* may be the object exist somewhere else
+ * wait the end of the loop to send back this error
+ */
+ flag_no_such_object = 1;
+ break;
+ }
+ /* err something other than LDAP_NO_SUCH_OBJECT, so the backend will have sent the result -
+ Set a flag here so we don't return another result. */
sent_result = 1;
/* fall through */
diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c
index 4dd252d0..ebc7990d 100644
--- a/ldap/servers/slapd/result.c
+++ b/ldap/servers/slapd/result.c
@@ -573,7 +573,7 @@ send_nobackend_ldap_result( Slapi_PBlock *pb )
err in the pblock, so this function needs to also */
slapi_pblock_set(pb, SLAPI_RESULT_CODE, &err);
- send_ldap_result( pb, err, NULL, NULL, 0, refurls );
+ slapi_send_ldap_result( pb, err, NULL, NULL, 0, refurls );
}