[Fedora-directory-commits] ldapserver/ldap/servers/slapd opshared.c, 1.9, 1.10 result.c, 1.10, 1.11

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Wed Oct 3 17:44:53 UTC 2007


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv488/ldapserver/ldap/servers/slapd

Modified Files:
	opshared.c result.c 
Log Message:
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



Index: opshared.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/opshared.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- opshared.c	2 Oct 2007 19:21:32 -0000	1.9
+++ opshared.c	3 Oct 2007 17:44:50 -0000	1.10
@@ -546,10 +546,22 @@
     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 */
 


Index: result.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/result.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- result.c	10 Nov 2006 23:45:40 -0000	1.10
+++ result.c	3 Oct 2007 17:44:50 -0000	1.11
@@ -573,7 +573,7 @@
 	   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 );
 }
 
 




More information about the Fedora-directory-commits mailing list