]> git.sur5r.net Git - openldap/commitdiff
unifdef -DBDB_SUBENTRIES -DLDBM_SUBENTRIES
authorKurt Zeilenga <kurt@openldap.org>
Sun, 27 Nov 2005 01:03:03 +0000 (01:03 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 27 Nov 2005 01:03:03 +0000 (01:03 +0000)
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/back-bdb.h
servers/slapd/back-bdb/bind.c
servers/slapd/back-bdb/init.c
servers/slapd/back-bdb/search.c
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/back-ldbm.h
servers/slapd/back-ldbm/bind.c
servers/slapd/back-ldbm/init.c
servers/slapd/back-ldbm/search.c

index a7273ef7c7291ee08cd25018b8bbd62c4c97e231..128c00d0593683ea47566cae0caf76dc02521d9e 100644 (file)
@@ -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 );
index 854a9b80ffa927f88ea4f00e201b62f10deaef6d..ca6bd83c51f4a0a575f35a54abf26c603e3645ea 100644 (file)
@@ -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      '@'
index 69d37564624622c771b70112e81f286fb095037b..ed76a6283ffb5f05088ad09ca141357de4135a0b 100644 (file)
@@ -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 */
index 991bbc033f264c15bf214067cbfb27c73571b380..12eebe2327e543d3eeb289bdaa9eabc5d744342a 100644 (file)
@@ -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;
 
index e39c23daf936a4b45e73340ca72e600f92e5fb5b..4dc16019e22857640f3c8d63c87fb688c061818f 100644 (file)
@@ -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 ) {
index 0f98eca3d0ffc46cbda6303507bee694cddb98ff..1ffc2223878a73b8d548bc73d025760759c7d495 100644 (file)
@@ -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' );
index ea1c96acc601ca038a13192cda749774e1bbae1b..ebc39c71eeb9ee6fb805566916cc951a393e892b 100644 (file)
@@ -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
index dce317876a1ff38e561713b5a045f244f8f78f0c..ee4f801c9cc10b0a25364b5d00f6cd4659b492f0 100644 (file)
@@ -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 */
index 0f82638dcaab9736e716b0ce88cc36169d190da8..f588cb7620c5399abc679344ccdebcaa8dba9739 100644 (file)
@@ -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;
 
index 455e31ccd942bdcf5e081bd0591a2e907f5a473a..148dfb23f7daec2eb0f11712e990bf40c19ca442 100644 (file)
@@ -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 );