From 48cb85865deef86f80302d23c3d50d7923a25783 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 26 Nov 2005 07:38:18 +0000 Subject: [PATCH] Remove some unnecessary #ifdefs --- servers/slapd/back-bdb/init.c | 4 ---- servers/slapd/back-ldbm/init.c | 2 -- servers/slapd/back-ldbm/search.c | 2 -- servers/slapd/back-meta/candidates.c | 2 -- servers/slapd/back-meta/config.c | 2 -- servers/slapd/back-meta/search.c | 9 +-------- servers/slapd/back-sql/search.c | 18 ++---------------- servers/slapd/backglue.c | 2 -- servers/slapd/overlays/syncprov.c | 2 -- servers/slapd/saslauthz.c | 2 -- servers/slapd/search.c | 2 -- servers/slapd/slapi/slapi_pblock.c | 2 -- servers/slapd/syncrepl.c | 2 -- 13 files changed, 3 insertions(+), 48 deletions(-) diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 1eb44efebb..991bbc033f 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -641,12 +641,8 @@ bdb_back_initialize( LDAP_CONTROL_MANAGEDSAIT, LDAP_CONTROL_NOOP, LDAP_CONTROL_PAGEDRESULTS, -#ifdef LDAP_CONTROL_SUBENTRIES LDAP_CONTROL_SUBENTRIES, -#endif -#ifdef LDAP_CONTROL_X_PERMISSIVE_MODIFY LDAP_CONTROL_X_PERMISSIVE_MODIFY, -#endif NULL }; diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index 1ceb19bc5c..0f82638dca 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -32,9 +32,7 @@ ldbm_back_initialize( { static char *controls[] = { LDAP_CONTROL_MANAGEDSAIT, -#ifdef LDAP_CONTROL_X_PERMISSIVE_MODIFY LDAP_CONTROL_X_PERMISSIVE_MODIFY, -#endif NULL }; diff --git a/servers/slapd/back-ldbm/search.c b/servers/slapd/back-ldbm/search.c index 633b7c2372..455e31ccd9 100644 --- a/servers/slapd/back-ldbm/search.c +++ b/servers/slapd/back-ldbm/search.c @@ -417,13 +417,11 @@ searchit: { scopeok = dnIsSuffix( &e->e_nname, &realbase ); -#ifdef LDAP_SCOPE_SUBORDINATE } else if ( !scopeok && op->ors_scope == LDAP_SCOPE_SUBORDINATE ) { scopeok = !dn_match( &e->e_nname, &realbase ) && dnIsSuffix( &e->e_nname, &realbase ); -#endif } else { scopeok = 1; diff --git a/servers/slapd/back-meta/candidates.c b/servers/slapd/back-meta/candidates.c index 1cc8d83a87..a73cc1516e 100644 --- a/servers/slapd/back-meta/candidates.c +++ b/servers/slapd/back-meta/candidates.c @@ -70,13 +70,11 @@ meta_back_is_candidate( default: return META_CANDIDATE; -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: if ( ndn->bv_len > nsuffix->bv_len ) { return META_CANDIDATE; } break; -#endif /* LDAP_SCOPE_SUBORDINATE */ /* nearly useless; not allowed by config */ case LDAP_SCOPE_ONELEVEL: diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c index ea78c2037b..3516b82e35 100644 --- a/servers/slapd/back-meta/config.c +++ b/servers/slapd/back-meta/config.c @@ -222,9 +222,7 @@ meta_back_db_config( break; case LDAP_SCOPE_SUBTREE: -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: -#endif /* LDAP_SCOPE_SUBORDINATE */ mi->mi_targets[ i ].mt_scope = ludp->lud_scope; break; diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 9f76beb98e..08f61b904d 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -102,11 +102,9 @@ meta_back_search_start( &op->o_req_ndn ) ) { realbase = mi->mi_targets[ candidate ].mt_nsuffix; -#ifdef LDAP_SCOPE_SUBORDINATE if ( mi->mi_targets[ candidate ].mt_scope == LDAP_SCOPE_SUBORDINATE ) { realscope = LDAP_SCOPE_SUBORDINATE; } -#endif /* LDAP_SCOPE_SUBORDINATE */ } else { /* @@ -116,9 +114,7 @@ meta_back_search_start( } break; -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: -#endif /* LDAP_SCOPE_SUBORDINATE */ case LDAP_SCOPE_ONELEVEL: { struct berval rdn = mi->mi_targets[ candidate ].mt_nsuffix; @@ -132,16 +128,13 @@ meta_back_search_start( * base, and make scope "base" */ realbase = mi->mi_targets[ candidate ].mt_nsuffix; -#ifdef LDAP_SCOPE_SUBORDINATE if ( op->ors_scope == LDAP_SCOPE_SUBORDINATE ) { if ( mi->mi_targets[ candidate ].mt_scope == LDAP_SCOPE_SUBORDINATE ) { realscope = LDAP_SCOPE_SUBORDINATE; } else { realscope = LDAP_SCOPE_SUBTREE; } - } else -#endif /* LDAP_SCOPE_SUBORDINATE */ - { + } else { realscope = LDAP_SCOPE_BASE; } break; diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index efc6507224..ba54bef33b 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -1436,9 +1436,7 @@ backsql_srch_query( backsql_srch_info *bsi, struct berval *query ) "ldap_entries.parent=?" ); break; -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: -#endif /* LDAP_SCOPE_SUBORDINATE */ case LDAP_SCOPE_SUBTREE: if ( BACKSQL_USE_SUBTREE_SHORTCUT( bi ) ) { int i; @@ -1679,9 +1677,7 @@ backsql_oc_get_candidates( void *v_oc, void *v_bsi ) } break; -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: -#endif /* LDAP_SCOPE_SUBORDINATE */ case LDAP_SCOPE_SUBTREE: { /* if short-cutting the search base, @@ -1720,11 +1716,9 @@ backsql_oc_get_candidates( void *v_oc, void *v_bsi ) tmp_base_ndn[ i ] = bsi->bsi_base_ndn->bv_val[ j ]; } -#ifdef LDAP_SCOPE_SUBORDINATE if ( bsi->bsi_scope == LDAP_SCOPE_SUBORDINATE ) { tmp_base_ndn[ i++ ] = ','; } -#endif /* LDAP_SCOPE_SUBORDINATE */ tmp_base_ndn[ i ] = '%'; tmp_base_ndn[ i + 1 ] = '\0'; @@ -1734,11 +1728,9 @@ backsql_oc_get_candidates( void *v_oc, void *v_bsi ) tmp_base_ndn[ i++ ] = '%'; -#ifdef LDAP_SCOPE_SUBORDINATE if ( bsi->bsi_scope == LDAP_SCOPE_SUBORDINATE ) { tmp_base_ndn[ i++ ] = ','; } -#endif /* LDAP_SCOPE_SUBORDINATE */ AC_MEMCPY( &tmp_base_ndn[ i ], bsi->bsi_base_ndn->bv_val, bsi->bsi_base_ndn->bv_len + 1 ); @@ -1750,13 +1742,10 @@ backsql_oc_get_candidates( void *v_oc, void *v_bsi ) ldap_pvt_str2upper( tmp_base_ndn ); } -#ifdef LDAP_SCOPE_SUBORDINATE if ( bsi->bsi_scope == LDAP_SCOPE_SUBORDINATE ) { Debug( LDAP_DEBUG_TRACE, "(children)dn: \"%s\"\n", tmp_base_ndn, 0, 0 ); - } else -#endif /* LDAP_SCOPE_SUBORDINATE */ - { + } else { Debug( LDAP_DEBUG_TRACE, "(sub)dn: \"%s\"\n", tmp_base_ndn, 0, 0 ); } @@ -2157,15 +2146,12 @@ backsql_search( Operation *op, SlapReply *rs ) /* fall thru */ } -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: /* discard the baseObject entry */ if ( dn_match( &eid->eid_ndn, &op->o_req_ndn ) ) { goto next_entry2; } - /* FALLTHRU */ -#endif /* LDAP_SCOPE_SUBORDINATE */ - + /* FALLTHRU */ case LDAP_SCOPE_SUBTREE: /* FIXME: this should never fail... */ if ( !dnIsSuffix( &eid->eid_ndn, &op->o_req_ndn ) ) { diff --git a/servers/slapd/backglue.c b/servers/slapd/backglue.c index 649f7098e0..ec2f78ac17 100644 --- a/servers/slapd/backglue.c +++ b/servers/slapd/backglue.c @@ -258,9 +258,7 @@ glue_op_search ( Operation *op, SlapReply *rs ) case LDAP_SCOPE_ONELEVEL: case LDAP_SCOPE_SUBTREE: -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: /* FIXME */ -#endif #if 0 if ( op->o_sync ) { diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 75c82cc59a..a62d0a0d0d 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -450,12 +450,10 @@ syncprov_findbase( Operation *op, fbase_cookie *fc ) case LDAP_SCOPE_SUBTREE: fc->fscope = dnIsSuffix( fc->fdn, &fc->fss->s_base ); break; -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: fc->fscope = dnIsSuffix( fc->fdn, &fc->fss->s_base ) && !dn_match( fc->fdn, &fc->fss->s_base ); break; -#endif } } diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index 106dca9112..42bb8a1368 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -1969,9 +1969,7 @@ slap_sasl2dn( case LDAP_SCOPE_BASE: case LDAP_SCOPE_ONELEVEL: case LDAP_SCOPE_SUBTREE: -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: -#endif /* do a search */ break; diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 6d9f57480a..97f3e923c1 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -92,9 +92,7 @@ do_search( case LDAP_SCOPE_BASE: case LDAP_SCOPE_ONELEVEL: case LDAP_SCOPE_SUBTREE: -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: -#endif break; default: send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid scope" ); diff --git a/servers/slapd/slapi/slapi_pblock.c b/servers/slapd/slapi/slapi_pblock.c index ef51920fb8..c314172878 100644 --- a/servers/slapd/slapi/slapi_pblock.c +++ b/servers/slapd/slapi/slapi_pblock.c @@ -1022,9 +1022,7 @@ pblock_set( Slapi_PBlock *pb, int param, void *value ) case LDAP_SCOPE_BASE: case LDAP_SCOPE_ONELEVEL: case LDAP_SCOPE_SUBTREE: -#ifdef LDAP_SCOPE_SUBORDINATE case LDAP_SCOPE_SUBORDINATE: -#endif pb->pb_op->ors_scope = scope; break; default: diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 2c539d9bcf..abce34456c 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2683,10 +2683,8 @@ static struct { { BER_BVC("base"), LDAP_SCOPE_BASE }, { BER_BVC("one"), LDAP_SCOPE_ONELEVEL }, { BER_BVC("onelevel"), LDAP_SCOPE_ONELEVEL }, /* OpenLDAP extension */ -#ifdef LDAP_SCOPE_SUBORDINATE { BER_BVC("children"), LDAP_SCOPE_SUBORDINATE }, { BER_BVC("subordinate"), LDAP_SCOPE_SUBORDINATE }, -#endif { BER_BVC("sub"), LDAP_SCOPE_SUBTREE }, { BER_BVC("subtree"), LDAP_SCOPE_SUBTREE }, /* OpenLDAP extension */ { BER_BVNULL, 0 } -- 2.39.5