From c86e07dd25806c87cd786e9a0b6044b66abbfc76 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 8 Apr 2004 12:15:26 +0000 Subject: [PATCH] Fix ITS#3063, special case handling of "" suffix --- servers/slapd/back-bdb/search.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index fca2473719..d61446a3b4 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -373,9 +373,9 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop, ID id, cursor; ID candidates[BDB_IDL_UM_SIZE]; ID scopes[BDB_IDL_DB_SIZE]; - Entry *e = NULL, base; + Entry *e = NULL, base, e_root = {0}; Entry *matched = NULL; - EntryInfo *ei; + EntryInfo *ei, ei_root = {0}; struct berval realbase = BER_BVNULL; int manageDSAit; int tentries = 0; @@ -522,7 +522,11 @@ bdb_do_search( Operation *op, SlapReply *rs, Operation *sop, if ( sop->o_req_ndn.bv_len == 0 ) { /* DIT root special case */ - e = (Entry *) &slap_entry_root; + ei_root.bei_e = &e_root; + ei_root.bei_parent = &ei_root; + e_root.e_private = &ei_root; + e_root.e_id = 1; + ei = &ei_root; rs->sr_err = LDAP_SUCCESS; } else { dn2entry_retry: @@ -599,7 +603,7 @@ dn2entry_retry: return rs->sr_err; } - if ( !manageDSAit && e != &slap_entry_root && is_entry_referral( e ) ) { + if ( !manageDSAit && e != &e_root && is_entry_referral( e ) ) { /* entry is a referral, don't allow add */ struct berval matched_dn; BerVarray erefs; @@ -658,7 +662,7 @@ dn2entry_retry: base.e_nname = realbase; base.e_id = e->e_id; - if ( e != &slap_entry_root ) { + if ( e != &e_root ) { bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, e, &lock); } e = NULL; -- 2.39.5