From b29e311ae7d44186295963c22898d72b6f49ef3c Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 5 Nov 2004 07:48:15 +0000 Subject: [PATCH] unifdef -DBDB_ALIASES delete dead code --- servers/slapd/back-bdb/add.c | 2 -- servers/slapd/back-bdb/back-bdb.h | 2 -- servers/slapd/back-bdb/bind.c | 16 ---------------- servers/slapd/back-bdb/filterindex.c | 24 ------------------------ servers/slapd/back-bdb/id2entry.c | 2 -- servers/slapd/back-bdb/init.c | 2 -- servers/slapd/back-bdb/modrdn.c | 2 -- servers/slapd/back-bdb/search.c | 28 ++-------------------------- 8 files changed, 2 insertions(+), 76 deletions(-) diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 651281ece8..07b8265283 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -208,7 +208,6 @@ retry: /* transaction retry */ goto return_results;; } #endif -#ifdef BDB_ALIASES if ( is_entry_alias( p ) ) { /* parent is an alias, don't allow add */ Debug( LDAP_DEBUG_TRACE, "bdb_add: parent is alias\n", @@ -217,7 +216,6 @@ retry: /* transaction retry */ rs->sr_text = "parent is an alias"; goto return_results;; } -#endif if ( is_entry_referral( p ) ) { /* parent is a referral, don't allow add */ diff --git a/servers/slapd/back-bdb/back-bdb.h b/servers/slapd/back-bdb/back-bdb.h index a95b084f11..40227ccd9e 100644 --- a/servers/slapd/back-bdb/back-bdb.h +++ b/servers/slapd/back-bdb/back-bdb.h @@ -41,8 +41,6 @@ LDAP_BEGIN_DECL #define BDB_MAX_ADD_LOOP 30 -#define BDB_ALIASES 1 - #ifdef BDB_SUBDIRS #define BDB_TMP_SUBDIR "tmp" #define BDB_LG_SUBDIR "log" diff --git a/servers/slapd/back-bdb/bind.c b/servers/slapd/back-bdb/bind.c index 5b1df1b9ce..c4a2092e0a 100644 --- a/servers/slapd/back-bdb/bind.c +++ b/servers/slapd/back-bdb/bind.c @@ -114,20 +114,12 @@ dn2entry_retry: } #endif -#ifdef BDB_ALIASES if ( is_entry_alias( e ) ) { /* entry is an alias, don't allow bind */ Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0, 0, 0 ); - -#if 1 rs->sr_err = LDAP_INVALID_CREDENTIALS; -#else - rs->sr_err = LDAP_ALIAS_PROBLEM; - rs->sr_text = "entry is alias"; -#endif goto done; } -#endif if ( is_entry_referral( e ) ) { Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0, @@ -141,20 +133,12 @@ dn2entry_retry: rs->sr_err = access_allowed( op, e, password, NULL, ACL_AUTH, NULL ); if ( ! rs->sr_err ) { -#if 1 rs->sr_err = LDAP_INVALID_CREDENTIALS; -#else - rs->sr_err = LDAP_INSUFFICIENT_ACCESS; -#endif goto done; } if ( (a = attr_find( e->e_attrs, password )) == NULL ) { -#if 1 rs->sr_err = LDAP_INVALID_CREDENTIALS; -#else - rs->sr_err = LDAP_INAPPROPRIATE_AUTH; -#endif goto done; } diff --git a/servers/slapd/back-bdb/filterindex.c b/servers/slapd/back-bdb/filterindex.c index 573f5890a2..62cd9b7f18 100644 --- a/servers/slapd/back-bdb/filterindex.c +++ b/servers/slapd/back-bdb/filterindex.c @@ -67,9 +67,6 @@ bdb_filter_candidates( { int rc = 0; Debug( LDAP_DEBUG_FILTER, "=> bdb_filter_candidates\n", 0, 0, 0 ); -#if 0 - char *subtree="SUBTREE"; -#endif switch ( f->f_choice ) { case SLAPD_FILTER_COMPUTED: @@ -91,27 +88,6 @@ bdb_filter_candidates( break; } break; -#if 0 /* Not used any more, search calls bdb_dn2idl directly */ - case SLAPD_FILTER_DN_ONE: - Debug( LDAP_DEBUG_FILTER, "\tDN ONE\n", 0, 0, 0 ); - rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_ONE_PREFIX, ids, - stack, op->o_tmpmemctx ); - if( rc == DB_NOTFOUND ) { - BDB_IDL_ZERO( ids ); - rc = 0; - } - break; - - case SLAPD_FILTER_DN_CHILDREN: - subtree="CHILDREN"; - /* Fall Thru */ - case SLAPD_FILTER_DN_SUBTREE: - Debug( LDAP_DEBUG_FILTER, "\tDN %s\n", - subtree, 0, 0 ); - rc = bdb_dn2idl( op->o_bd, f->f_dn, DN_SUBTREE_PREFIX, ids, - stack, op->o_tmpmemctx ); - break; -#endif case LDAP_FILTER_PRESENT: Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 ); rc = presence_candidates( op, f->f_desc, ids ); diff --git a/servers/slapd/back-bdb/id2entry.c b/servers/slapd/back-bdb/id2entry.c index c27f631089..cdef3f488d 100644 --- a/servers/slapd/back-bdb/id2entry.c +++ b/servers/slapd/back-bdb/id2entry.c @@ -313,7 +313,6 @@ dn2entry_retry: "=> bdb_entry_get: found entry: \"%s\"\n", ndn->bv_val, 0, 0 ); -#ifdef BDB_ALIASES /* find attribute values */ if( is_entry_alias( e ) ) { Debug( LDAP_DEBUG_ACL, @@ -321,7 +320,6 @@ dn2entry_retry: rc = LDAP_ALIAS_PROBLEM; goto return_results; } -#endif if( is_entry_referral( e ) ) { Debug( LDAP_DEBUG_ACL, diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index cc3118f603..217c662cf6 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -572,9 +572,7 @@ bdb_initialize( #ifdef BDB_SUBENTRIES SLAP_BFLAG_SUBENTRIES | #endif -#ifdef BDB_ALIASES SLAP_BFLAG_ALIASES | -#endif SLAP_BFLAG_REFERRALS; bi->bi_controls = controls; diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index 014ad8a9b7..042311b00f 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -474,7 +474,6 @@ retry: /* transaction retry */ goto return_results; } -#ifdef BDB_ALIASES if ( is_entry_alias( np ) ) { /* parent is an alias, don't allow add */ Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: entry is alias\n", @@ -483,7 +482,6 @@ retry: /* transaction retry */ rs->sr_err = LDAP_ALIAS_PROBLEM; goto return_results; } -#endif if ( is_entry_referral( np ) ) { /* parent is a referral, don't allow add */ diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index ca54be4af5..ad1ac12d7f 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -1294,7 +1294,6 @@ id2entry_retry: } break; } -#ifdef BDB_ALIASES /* aliases were already dereferenced in candidate list */ if ( sop->ors_deref & LDAP_DEREF_SEARCHING ) { /* but if the search base is an alias, and we didn't @@ -1326,7 +1325,6 @@ id2entry_retry: } } } -#endif /* Not in scope, ignore it */ if ( !IS_POST_SEARCH && !scopeok ) { @@ -2022,14 +2020,8 @@ parse_paged_cookie( Operation *op, SlapReply *rs ) return LDAP_PROTOCOL_ERROR; } - /* Already tested by frontend */ + /* Tested by frontend */ assert( c[0]->ldctl_value.bv_len > 0 ); -#if 0 - if ( c[0]->ldctl_value.bv_len == 0 ) { - rs->sr_text = "paged results control value is empty (or absent)"; - return LDAP_PROTOCOL_ERROR; - } -#endif /* Parse the control value * realSearchControlValue ::= SEQUENCE { @@ -2047,25 +2039,9 @@ parse_paged_cookie( Operation *op, SlapReply *rs ) tag = ber_scanf( ber, "{im}", &size, &cookie ); - /* Already tested by frontend */ + /* Tested by frontend */ assert( tag != LBER_ERROR ); -#if 0 - if ( tag == LBER_ERROR ) { - rs->sr_text = "paged results control could not be decoded"; - rc = LDAP_PROTOCOL_ERROR; - goto done; - } -#endif - - /* Already tested by frontend */ assert( size >= 0 ); -#if 0 - if ( size < 0 ) { - rs->sr_text = "paged results control size invalid"; - rc = LDAP_PROTOCOL_ERROR; - goto done; - } -#endif /* cookie decoding/checks deferred to backend... */ if ( cookie.bv_len ) { -- 2.39.5