[Fedora-directory-commits] ldapserver/ldap/servers/slapd/back-ldbm filterindex.c, 1.7, 1.8

Noriko Hosoi nhosoi at fedoraproject.org
Fri Dec 12 01:21:56 UTC 2008


Author: nhosoi

Update of /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12405/back-ldbm

Modified Files:
	filterindex.c 
Log Message:
Resolves: #475899
Summary: extensible filter having range operation crashes the server (comment#7)
Description: As Rich suggested, set the pb->pb_op to glob_pb->pb_op to catch
the abandon request in case the underlying operation is interrupted.



Index: filterindex.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/slapd/back-ldbm/filterindex.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- filterindex.c	5 Dec 2008 21:03:52 -0000	1.7
+++ filterindex.c	12 Dec 2008 01:21:53 -0000	1.8
@@ -335,7 +335,7 @@
 {
     char    *type;
     IDList  *idl;
-	int     unindexed = 0;
+    int     unindexed = 0;
 
     LDAPDebug( LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 );
 
@@ -379,6 +379,7 @@
     IDList* idl = NULL;
     Slapi_PBlock* pb = slapi_pblock_new();
     int mrOP = 0;
+    Slapi_Operation *op = NULL;
     LDAPDebug (LDAP_DEBUG_TRACE, "=> extensible_candidates\n", 0, 0, 0);
     if ( ! slapi_mr_filter_index (f, pb) &&    !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_QUERY_OPERATOR, &mrOP))
     {
@@ -389,13 +390,18 @@
         case SLAPI_OP_EQUAL:
         case SLAPI_OP_GREATER_OR_EQUAL:
         case SLAPI_OP_GREATER:
-               {
+            {
             IFP mrINDEX = NULL;
             void* mrOBJECT = NULL;
             struct berval** mrVALUES = NULL;
             char* mrOID = NULL;
             char* mrTYPE = NULL;
 
+            /* set the pb->pb_op to glob_pb->pb_op to catch the abandon req.
+             * in case the operation is interrupted. */
+            slapi_pblock_get (glob_pb, SLAPI_OPERATION, &op);
+            slapi_pblock_set (pb, SLAPI_OPERATION, op);
+
             slapi_pblock_get (pb, SLAPI_PLUGIN_MR_INDEX_FN, &mrINDEX);
             slapi_pblock_get (pb, SLAPI_PLUGIN_OBJECT, &mrOBJECT);
             slapi_pblock_get (pb, SLAPI_PLUGIN_MR_VALUES, &mrVALUES);
@@ -493,6 +499,8 @@
         idl = idl_allids (be); /* all entries are candidates */
     }
 return_idl:
+    op = NULL;
+    slapi_pblock_set (pb, SLAPI_OPERATION, op);
     slapi_pblock_destroy (pb);
     LDAPDebug (LDAP_DEBUG_TRACE, "<= extensible_candidates %lu\n", 
                    (u_long)IDL_NIDS(idl), 0, 0);
@@ -746,7 +754,7 @@
             if ( (ftype == LDAP_FILTER_AND) && ((idl == NULL) ||
                 (idl_length(idl) <= FILTER_TEST_THRESHOLD))) {
                 break; /* We can exit the loop now, since the candidate list is small already */
-			}
+            }
         } else if ( ftype == LDAP_FILTER_AND ) {
             if (isnot) {
                 IDList *new_idl = NULL;




More information about the Fedora-directory-commits mailing list