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;
goto return_results;
}
-#ifdef BDB_SUBENTRIES
subentry = is_entry_subentry( op->oq_add.rs_e );
-#endif
/*
* acquire an ID outside of the operation transaction
goto return_results;;
}
-#ifdef BDB_SUBENTRIES
if ( is_entry_subentry( p ) ) {
/* parent is a subentry, don't allow add */
Debug( LDAP_DEBUG_TRACE,
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,
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 );
#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 '@'
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,
rs->sr_err = LDAP_INVALID_CREDENTIALS;
goto done;
}
-#endif
if ( is_entry_alias( e ) ) {
/* entry is an alias, don't allow bind */
bi->bi_flags |=
SLAP_BFLAG_INCREMENT |
-#ifdef BDB_SUBENTRIES
SLAP_BFLAG_SUBENTRIES |
-#endif
SLAP_BFLAG_ALIASES |
SLAP_BFLAG_REFERRALS;
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?
*
#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
/*
/* 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;
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 ) {
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);
}
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 ) )
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 );
rs->sr_text = "parent is a subentry";
goto return_results;
}
-#endif
if ( is_entry_alias( p ) ) {
/* parent is an alias, don't allow 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' );
LDAP_BEGIN_DECL
-#define LDBM_SUBENTRIES 1
-
#define DEFAULT_CACHE_SIZE 1000
#if defined(HAVE_BERKELEY_DB) && DB_VERSION_MAJOR >= 2
}
/* check for deleted */
-#ifdef LDBM_SUBENTRIES
+
if ( is_entry_subentry( e ) ) {
/* entry is an subentry, don't allow bind */
Debug( LDAP_DEBUG_TRACE,
rc = LDAP_INVALID_CREDENTIALS;
goto return_results;
}
-#endif
if ( is_entry_alias( e ) ) {
/* entry is an alias, don't allow bind */
bi->bi_flags |=
SLAP_BFLAG_INCREMENT |
-#ifdef LDBM_SUBENTRIES
SLAP_BFLAG_SUBENTRIES |
-#endif
SLAP_BFLAG_ALIASES |
SLAP_BFLAG_REFERRALS;
rs->sr_entry = e;
-#ifdef LDBM_SUBENTRIES
if ( is_entry_subentry( e ) ) {
if( op->ors_scope != LDAP_SCOPE_BASE ) {
if(!get_subentries_visibility( op )) {
/* only subentries are visible */
goto loop_continue;
}
-#endif
if ( op->ors_deref & LDAP_DEREF_SEARCHING &&
is_entry_alias( e ) )
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",
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;
sf.f_next = fand.f_next;
fand.f_next = &sf;
}
-#endif
candidates = filter_candidates( op, &f );
return( candidates );