bi->bi_op_add = bdb_add;
bi->bi_op_compare = bdb_compare;
bi->bi_op_delete = bdb_delete;
+ bi->bi_op_search = bdb_search;
+
#if 0
- bi->bi_op_bind = bi_back_bind;
- bi->bi_op_unbind = bi_back_unbind;
- bi->bi_op_search = bi_back_search;
- bi->bi_op_modify = bi_back_modify;
- bi->bi_op_modrdn = bi_back_modrdn;
- bi->bi_op_abandon = bi_back_abandon;
-
- bi->bi_extended = bi_back_extended;
-
- bi->bi_acl_group = bi_back_group;
- bi->bi_acl_attribute = bi_back_attribute;
- bi->bi_chk_referrals = bi_back_referrals;
+ bi->bi_op_bind = bdb_bind;
+ bi->bi_op_unbind = bdb_unbind;
+ bi->bi_op_modify = bdb_modify;
+ bi->bi_op_modrdn = bdb_modrdn;
+ bi->bi_op_abandon = bdb_abandon;
+
+ bi->bi_extended = bdb_extended;
+
+ bi->bi_acl_group = bdb_group;
+ bi->bi_acl_attribute = bdb_attribute;
+ bi->bi_chk_referrals = bdb_referrals;
#endif
+
bi->bi_entry_release_rw = 0;
/*
Backend *be,
Entry *e,
ID *ids );
-int search_candidates();
+static int search_candidates(
+ Backend *be,
+ Entry *e,
+ Filter *filter,
+ int scope,
+ int deref,
+ int manageDSAit,
+ ID *ids );
static ID idl_first( ID *ids, ID *cursor );
static ID idl_next( ID *ids, ID *cursor );
{
int abandon;
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
- int rc, err;
+ int rc;
const char *text = NULL;
time_t stoptime;
ID candidates[BDB_IDL_SIZE];
Debug(LDAP_DEBUG_TRACE, "=> ldbm_back_search\n", 0, 0, 0);
- /* obtain entry */
- rc = dn2entry_r( be, NULL, nbase, &e, &matched );
+#ifdef BDB_ALIASES
+ /* get entry with reader lock */
+ if ( deref & LDAP_DEREF_FINDING ) {
+ e = deref_dn_r( be, nbase, &err, &matched, &text );
+
+ } else
+#endif
+ {
+ /* obtain entry */
+ rc = dn2entry_r( be, NULL, nbase, &e, &matched );
+ }
switch(rc) {
case DB_NOTFOUND:
refs = default_referral;
}
- send_ldap_result( conn, op, err,
+ send_ldap_result( conn, op, rc=LDAP_REFERRAL ,
matched_dn, text, refs, NULL );
if( matched != NULL ) {
bdb_entry_return( be, matched );
}
- return 1;
+ return rc;
}
if (!manageDSAit && is_entry_referral( e ) ) {
return 1;
}
- if ( is_entry_alias( e ) ) {
- /* don't deref */
- deref = LDAP_DEREF_NEVER;
- }
-
if ( tlimit == 0 && be_isroot( be, op->o_ndn ) ) {
tlimit = -1; /* allow root to set no limit */
} else {
/* check time limit */
if ( tlimit != -1 && slap_get_time() > stoptime ) {
- send_search_result( conn, op, LDAP_TIMELIMIT_EXCEEDED,
+ send_search_result( conn, op, rc = LDAP_TIMELIMIT_EXCEEDED,
NULL, NULL, v2refs, NULL, nentries );
- rc = 0;
goto done;
}
goto loop_continue;
}
+#ifdef BDB_ALIASES
if ( deref & LDAP_DEREF_SEARCHING && is_entry_alias( e ) ) {
Entry *matched;
int err;
scopeok = 1;
}
+#endif
/*
* if it's a referral, add it to the list of referrals. only do
}
/* if it matches the filter and scope, send it */
- if ( test_filter( be, conn, op, e, filter ) == LDAP_COMPARE_TRUE ) {
+ rc = test_filter( be, conn, op, e, filter );
+ if ( rc == LDAP_COMPARE_TRUE ) {
char *dn;
/* check scope */
if ( --slimit == -1 ) {
bdb_entry_return( be, e );
send_search_result( conn, op,
- LDAP_SIZELIMIT_EXCEEDED, NULL, NULL,
+ rc = LDAP_SIZELIMIT_EXCEEDED, NULL, NULL,
v2refs, NULL, nentries );
- rc = 0;
goto done;
}
break;
case -1: /* connection closed */
bdb_entry_return( be, e );
- rc = 0;
+ rc = LDAP_OTHER;
goto done;
}
}
done:
ber_bvecfree( v2refs );
- if( realbase ) free( realbase );
+ if( realbase ) ch_free( realbase );
return rc;
}
return 0;
}
+static int search_candidates(
+ Backend *be,
+ Entry *e,
+ Filter *filter,
+ int scope,
+ int deref,
+ int manageDSAit,
+ ID *ids )
+{
+ Debug(LDAP_DEBUG_TRACE, "subtree_candidates: base: \"%s\" (0x08lx)\n",
+ e->e_dn, (long) e->e_id, 0);
+
+ ids[0] = NOID;
+ return 0;
+}
+
static ID idl_first( ID *ids, ID *cursor )
{
ID pos;