unifdef -DBDB_SUBENTRIES -DLDBM_SUBENTRIES

This commit is contained in:
Kurt Zeilenga 2005-11-27 01:03:03 +00:00
parent 21f91438b6
commit 0d56ddda04
10 changed files with 11 additions and 52 deletions

View 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 );

View 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 '@'

View 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 */

View 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;

View 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 ) {

View 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' );

View 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

View 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 */

View 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;

View 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 );