]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/search.c
document option '-F'
[openldap] / servers / slapd / back-bdb / search.c
index 9b863f1217b92b2022445a0fae075ed1b4b73986..830497e49fa82c2371a055d83bbd653cf49b625f 100644 (file)
@@ -43,9 +43,6 @@ static void send_paged_response(
        ID  *lastid,
        int tentries );
 
-static int bdb_pfid_cmp( const void *v_id1, const void *v_id2 );
-static ID* bdb_id_dup( Operation *op, ID *id );
-
 /* Dereference aliases for a single alias entry. Return the final
  * dereferenced entry on success, NULL on any failure.
  */
@@ -153,7 +150,11 @@ static int search_aliases(
        Entry *matched, *a;
        EntryInfo *ei;
        struct berval bv_alias = BER_BVC( "alias" );
-       AttributeAssertion aa_alias;
+#ifdef LDAP_COMP_MATCH
+       AttributeAssertion aa_alias = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion aa_alias = { NULL, BER_BVNULL };
+#endif
        Filter  af;
        DB_LOCK locka, lockr;
        int first = 1;
@@ -637,19 +638,16 @@ dn2entry_retry:
                goto loop_begin;
        }
 
-loop_start:
-
        for ( id = bdb_idl_first( candidates, &cursor );
                  id != NOID ; id = bdb_idl_next( candidates, &cursor ) )
        {
                int scopeok = 0;
-               ID* idhole = NULL;
 
 loop_begin:
 
                /* check for abandon */
                if ( op->o_abandon ) {
-                       rs->sr_err = LDAP_SUCCESS;
+                       rs->sr_err = SLAPD_ABANDON;
                        goto done;
                }
 
@@ -1022,10 +1020,18 @@ static int search_candidates(
        int rc, depth = 1;
        Filter          f, rf, xf, nf;
        ID              *stack;
-       AttributeAssertion aa_ref;
+#ifdef LDAP_COMP_MATCH
+       AttributeAssertion aa_ref = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion aa_ref = { NULL, BER_BVNULL };
+#endif
 #ifdef BDB_SUBENTRIES
        Filter  sf;
-       AttributeAssertion aa_subentry;
+#ifdef LDAP_COMP_MATCH
+       AttributeAssertion aa_subentry = { NULL, BER_BVNULL, NULL };
+#else
+       AttributeAssertion aa_subentry = { NULL, BER_BVNULL };
+#endif
 #endif
 
        /*
@@ -1255,7 +1261,8 @@ send_paged_response(
 
        op->o_conn->c_pagedresults_state.ps_cookie = respcookie;
        op->o_conn->c_pagedresults_state.ps_count =
-               ((PagedResultsState *)op->o_pagedresults_state)->ps_count + rs->sr_nentries;
+               ((PagedResultsState *)op->o_pagedresults_state)->ps_count +
+               rs->sr_nentries;
 
        /* return size of 0 -- no estimate */
        ber_printf( ber, "{iO}", 0, &cookie ); 
@@ -1276,18 +1283,3 @@ done:
        (void) ber_free_buf( ber );
 }
 
-static int
-bdb_pfid_cmp( const void *v_id1, const void *v_id2 )
-{
-    const ID *p1 = v_id1, *p2 = v_id2;
-       return *p1 - *p2;
-}
-
-static ID*
-bdb_id_dup( Operation *op, ID *id )
-{
-       ID *new;
-       new = ch_malloc( sizeof(ID) );
-       *new = *id;
-       return new;
-}