From: Kurt Zeilenga Date: Sun, 27 Nov 2005 01:03:03 +0000 (+0000) Subject: unifdef -DBDB_SUBENTRIES -DLDBM_SUBENTRIES X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~671 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0d56ddda04b8c80aea86dbdbe3cf539d0e9188c9;p=openldap unifdef -DBDB_SUBENTRIES -DLDBM_SUBENTRIES --- diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index a7273ef7c7..128c00d059 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -34,9 +34,7 @@ bdb_add(Operation *op, SlapReply *rs ) AttributeDescription *entry = slap_schema.si_ad_entry; DB_TXN *ltid = NULL, *lt2; struct bdb_op_info opinfo = {0}; -#ifdef BDB_SUBENTRIES int subentry; -#endif u_int32_t locker = 0; DB_LOCK lock; @@ -65,9 +63,7 @@ bdb_add(Operation *op, SlapReply *rs ) goto return_results; } -#ifdef BDB_SUBENTRIES subentry = is_entry_subentry( op->oq_add.rs_e ); -#endif /* * acquire an ID outside of the operation transaction @@ -196,7 +192,6 @@ retry: /* transaction retry */ goto return_results;; } -#ifdef BDB_SUBENTRIES if ( is_entry_subentry( p ) ) { /* parent is a subentry, don't allow add */ Debug( LDAP_DEBUG_TRACE, @@ -206,7 +201,6 @@ retry: /* transaction retry */ rs->sr_text = "parent is a subentry"; goto return_results;; } -#endif if ( is_entry_alias( p ) ) { /* parent is an alias, don't allow add */ Debug( LDAP_DEBUG_TRACE, @@ -233,12 +227,10 @@ retry: /* transaction retry */ goto return_results; } -#ifdef BDB_SUBENTRIES if ( subentry ) { /* FIXME: */ /* parent must be an administrative point of the required kind */ } -#endif /* free parent and reader lock */ bdb_unlocked_cache_return_entry_r( &bdb->bi_cache, p ); diff --git a/servers/slapd/back-bdb/back-bdb.h b/servers/slapd/back-bdb/back-bdb.h index 854a9b80ff..ca6bd83c51 100644 --- a/servers/slapd/back-bdb/back-bdb.h +++ b/servers/slapd/back-bdb/back-bdb.h @@ -26,8 +26,6 @@ LDAP_BEGIN_DECL #define DB_VERSION_FULL ((DB_VERSION_MAJOR << 24) | (DB_VERSION_MINOR << 16) | DB_VERSION_PATCH) -#define BDB_SUBENTRIES 1 - #define DN_BASE_PREFIX SLAP_INDEX_EQUALITY_PREFIX #define DN_ONE_PREFIX '%' #define DN_SUBTREE_PREFIX '@' diff --git a/servers/slapd/back-bdb/bind.c b/servers/slapd/back-bdb/bind.c index 69d3756462..ed76a6283f 100644 --- a/servers/slapd/back-bdb/bind.c +++ b/servers/slapd/back-bdb/bind.c @@ -104,7 +104,6 @@ dn2entry_retry: ber_dupbv( &op->oq_bind.rb_edn, &e->e_name ); /* check for deleted */ -#ifdef BDB_SUBENTRIES if ( is_entry_subentry( e ) ) { /* entry is an subentry, don't allow bind */ Debug( LDAP_DEBUG_TRACE, "entry is subentry\n", 0, @@ -112,7 +111,6 @@ dn2entry_retry: rs->sr_err = LDAP_INVALID_CREDENTIALS; goto done; } -#endif if ( is_entry_alias( e ) ) { /* entry is an alias, don't allow bind */ diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 991bbc033f..12eebe2327 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -653,9 +653,7 @@ bdb_back_initialize( bi->bi_flags |= SLAP_BFLAG_INCREMENT | -#ifdef BDB_SUBENTRIES SLAP_BFLAG_SUBENTRIES | -#endif SLAP_BFLAG_ALIASES | SLAP_BFLAG_REFERRALS; diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index e39c23daf9..4dc16019e2 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -726,28 +726,24 @@ fetch_entry_retry: rs->sr_entry = e; -#ifdef BDB_SUBENTRIES - { - if ( is_entry_subentry( e ) ) { - if( op->oq_search.rs_scope != LDAP_SCOPE_BASE ) { - if(!get_subentries_visibility( op )) { - /* only subentries are visible */ - goto loop_continue; - } - - } else if ( get_subentries( op ) && - !get_subentries_visibility( op )) - { + if ( is_entry_subentry( e ) ) { + if( op->oq_search.rs_scope != LDAP_SCOPE_BASE ) { + if(!get_subentries_visibility( op )) { /* only subentries are visible */ goto loop_continue; } - } else if ( get_subentries_visibility( op )) { + } else if ( get_subentries( op ) && + !get_subentries_visibility( op )) + { /* only subentries are visible */ goto loop_continue; } + + } else if ( get_subentries_visibility( op )) { + /* only subentries are visible */ + goto loop_continue; } -#endif /* BDB_SUBENTRIES */ /* Does this candidate actually satisfy the search scope? * @@ -1051,13 +1047,11 @@ static int search_candidates( #else AttributeAssertion aa_ref = { NULL, BER_BVNULL }; #endif -#ifdef BDB_SUBENTRIES Filter sf; #ifdef LDAP_COMP_MATCH AttributeAssertion aa_subentry = { NULL, BER_BVNULL, NULL }; #else AttributeAssertion aa_subentry = { NULL, BER_BVNULL }; -#endif #endif /* @@ -1104,7 +1098,6 @@ static int search_candidates( /* Filter depth increased again, adding dummy clause */ depth++; -#ifdef BDB_SUBENTRIES if( get_subentries_visibility( op ) ) { struct berval bv_subentry = BER_BVC( "subentry" ); sf.f_choice = LDAP_FILTER_EQUALITY; @@ -1114,7 +1107,6 @@ static int search_candidates( sf.f_next = nf.f_next; nf.f_next = &sf; } -#endif /* Allocate IDL stack, plus 1 more for former tmp */ if ( depth+1 > bdb->bi_search_stack_depth ) { diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 0f98eca3d0..1ffc222387 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -49,9 +49,7 @@ ldbm_back_add( char textbuf[SLAP_TEXT_BUFLEN]; size_t textlen = sizeof textbuf; slap_callback cb = { NULL }; -#ifdef LDBM_SUBENTRIES int subentry; -#endif Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", op->o_req_dn.bv_val, 0, 0); @@ -74,9 +72,7 @@ ldbm_back_add( } rs->sr_text = NULL; -#ifdef LDBM_SUBENTRIES subentry = is_entry_subentry( op->oq_add.rs_e ); -#endif if ( !access_allowed( op, op->oq_add.rs_e, entry, NULL, ACL_WADD, NULL ) ) @@ -162,7 +158,6 @@ ldbm_back_add( return LDAP_INSUFFICIENT_ACCESS; } -#ifdef LDBM_SUBENTRIES if ( is_entry_subentry( p )) { Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is subentry\n", 0, 0, 0 ); @@ -170,7 +165,6 @@ ldbm_back_add( rs->sr_text = "parent is a subentry"; goto return_results; } -#endif if ( is_entry_alias( p ) ) { /* parent is an alias, don't allow add */ @@ -211,12 +205,10 @@ ldbm_back_add( return rs->sr_err; } -#ifdef LDBM_SUBENTRIES if ( subentry ) { /* FIXME: */ /* parent must be an administrative point of the required kind */ } -#endif } else { assert( pdn.bv_val == NULL || *pdn.bv_val == '\0' ); diff --git a/servers/slapd/back-ldbm/back-ldbm.h b/servers/slapd/back-ldbm/back-ldbm.h index ea1c96acc6..ebc39c71ee 100644 --- a/servers/slapd/back-ldbm/back-ldbm.h +++ b/servers/slapd/back-ldbm/back-ldbm.h @@ -22,8 +22,6 @@ LDAP_BEGIN_DECL -#define LDBM_SUBENTRIES 1 - #define DEFAULT_CACHE_SIZE 1000 #if defined(HAVE_BERKELEY_DB) && DB_VERSION_MAJOR >= 2 diff --git a/servers/slapd/back-ldbm/bind.c b/servers/slapd/back-ldbm/bind.c index dce317876a..ee4f801c9c 100644 --- a/servers/slapd/back-ldbm/bind.c +++ b/servers/slapd/back-ldbm/bind.c @@ -72,7 +72,7 @@ ldbm_back_bind( } /* check for deleted */ -#ifdef LDBM_SUBENTRIES + if ( is_entry_subentry( e ) ) { /* entry is an subentry, don't allow bind */ Debug( LDAP_DEBUG_TRACE, @@ -80,7 +80,6 @@ ldbm_back_bind( rc = LDAP_INVALID_CREDENTIALS; goto return_results; } -#endif if ( is_entry_alias( e ) ) { /* entry is an alias, don't allow bind */ diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index 0f82638dca..f588cb7620 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -40,9 +40,7 @@ ldbm_back_initialize( bi->bi_flags |= SLAP_BFLAG_INCREMENT | -#ifdef LDBM_SUBENTRIES SLAP_BFLAG_SUBENTRIES | -#endif SLAP_BFLAG_ALIASES | SLAP_BFLAG_REFERRALS; diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 455e31ccd9..148dfb23f7 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -272,7 +272,6 @@ searchit: rs->sr_entry = e; -#ifdef LDBM_SUBENTRIES if ( is_entry_subentry( e ) ) { if( op->ors_scope != LDAP_SCOPE_BASE ) { if(!get_subentries_visibility( op )) { @@ -289,7 +288,6 @@ searchit: /* only subentries are visible */ goto loop_continue; } -#endif if ( op->ors_deref & LDAP_DEREF_SEARCHING && is_entry_alias( e ) ) @@ -517,10 +515,8 @@ search_candidates( AttributeAssertion aa_ref, aa_alias; struct berval bv_ref = { sizeof("referral")-1, "referral" }; struct berval bv_alias = { sizeof("alias")-1, "alias" }; -#ifdef LDBM_SUBENTRIES Filter sf; AttributeAssertion aa_subentry; -#endif Debug(LDAP_DEBUG_TRACE, "search_candidates: base=\"%s\" s=%d d=%d\n", @@ -560,7 +556,6 @@ search_candidates( fand.f_dn = &e->e_nname; fand.f_next = xf.f_or == filter ? filter : &xf ; -#ifdef LDBM_SUBENTRIES if ( get_subentries_visibility( op )) { struct berval bv_subentry = { sizeof("SUBENTRY")-1, "SUBENTRY" }; sf.f_choice = LDAP_FILTER_EQUALITY; @@ -570,7 +565,6 @@ search_candidates( sf.f_next = fand.f_next; fand.f_next = &sf; } -#endif candidates = filter_candidates( op, &f ); return( candidates );