AttributeDescription *children = slap_schema.si_ad_children;
DB_TXN *ltid = NULL;
struct bdb_op_info opinfo;
+#ifdef BDB_SUBENTRIES
int subentry;
+#endif
#if 0
u_int32_t lockid;
DB_LOCK lock;
goto return_results;
}
+#ifdef BDB_SUBENTRIES
subentry = is_entry_subentry( 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, "bdb_add: parent is subentry\n",
text = "parent is a subentry";
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",
text = "parent is an alias";
goto return_results;;
}
+#endif
if ( is_entry_referral( p ) ) {
/* parent is a referral, don't allow add */
goto done;
}
+#ifdef BDB_SUBENTRIES
if ( subentry ) {
/* FIXME: */
/* parent must be an administrative point of the required kind */
}
+#endif
/* free parent and reader lock */
bdb_cache_return_entry_r( &bdb->bi_cache, p );
}
}
+#ifdef BDB_SUBENTRIES
if( subentry ) {
Debug( LDAP_DEBUG_TRACE,
"bdb_add: no parent, cannot add subentry\n",
text = "no parent, cannot add subentry";
goto return_results;;
}
+#endif
#if 0
if ( ltid ) {
DBT obj;
#endif
}
+#ifdef BDB_ALIASES
/* find attribute values */
if( is_entry_alias( e ) ) {
#ifdef NEW_LOGGING
rc = LDAP_ALIAS_PROBLEM;
goto return_results;
}
+#endif
if( is_entry_referral( e ) ) {
#ifdef NEW_LOGGING
LDAP_BEGIN_DECL
-#define BDB_FILTER_INDICES 1
#define BDB_IDL_MULTI 1
/* #define BDB_HIER 1 */
ber_dupbv( 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 alias\n", 0,
+ 0, 0 );
+
+ send_ldap_result( conn, op, rc = LDAP_INVALID_CREDENTIALS,
+ NULL, NULL, NULL, NULL );
+
+ goto done;
+ }
+#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,
goto done;
}
+#endif
if ( is_entry_referral( e ) ) {
/* entry is a referral, don't allow bind */
}
bdb->bi_dbenv_mode = strtol( argv[1], NULL, 0 );
-#if BDB_FILTER_INDICES
/* attribute to index */
} else if ( strcasecmp( argv[0], "index" ) == 0 ) {
int rc;
rc = bdb_attr_index_config( bdb, fname, lineno, argc - 1, &argv[1] );
if( rc != LDAP_SUCCESS ) return 1;
-#endif
/* size of the cache in entries */
} else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
}
if ( !manageDSAit && is_entry_referral( e ) ) {
- /* parent is a referral, don't allow add */
- /* parent is an alias, don't allow add */
+ /* entry is a referral, don't allow delete */
BerVarray refs = get_entry_referrals( be,
conn, op, e );
#include "back-bdb.h"
#include "idl.h"
-#ifdef BDB_FILTER_INDICES
-
static int presence_candidates(
Backend *be,
AttributeDescription *desc,
return( 0 );
}
-#endif
*/
rc = 1;
+#ifdef BDB_ALIASES
if( is_entry_alias( e ) ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_INFO,
#endif
goto return_results;
}
+#endif
if( is_entry_referral( e ) ) {
#ifdef NEW_LOGGING
0, 0, 0 );
/* indicate system schema supported */
- be->be_flags |= SLAP_BFLAG_ALIASES
- | SLAP_BFLAG_REFERRALS
- | SLAP_BFLAG_SUBENTRIES;
+ be->be_flags |=
+#ifdef BDB_SUBENTRIES
+ SLAP_BFLAG_SUBENTRIES |
+#endif
+#ifdef BDB_ALIASES
+ SLAP_BFLAG_ALIASES |
+#endif
+ SLAP_BFLAG_REFERRALS;
/* allocate backend-database-specific stuff */
bdb = (struct bdb_info *) ch_calloc( 1, sizeof(struct bdb_info) );
}
if ( !manageDSAit && is_entry_referral( e ) ) {
- /* parent is a referral, don't allow add */
- /* parent is an alias, don't allow add */
+ /* entry is a referral, don't allow modify */
BerVarray refs = get_entry_referrals( be,
conn, op, e );
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",
rc = LDAP_ALIAS_PROBLEM;
goto return_results;
}
+#endif
if ( is_entry_referral( np ) ) {
/* parent is a referral, don't allow add */
goto done;
}
+#ifdef BDB_SUBENTRIES
+ if( is_entry_subentries( e ) ) {
+ /* entry is an alias, don't allow operation */
+ *text = "authorization entry is subentry";
+ rc = LDAP_OTHER;
+ goto done;
+ }
+#endif
+#ifdef BDB_ALIASES
if( is_entry_alias( e ) ) {
/* entry is an alias, don't allow operation */
*text = "authorization entry is alias";
rc = LDAP_ALIAS_PROBLEM;
goto done;
}
-
+#endif
if( is_entry_referral( e ) ) {
/* entry is an referral, don't allow operation */
*text = "authorization entry is referral";
- rc = LDAP_OPERATIONS_ERROR;
+ rc = LDAP_OTHER;
goto done;
}
goto loop_continue;
}
+#ifdef BDB_SUBENTRIES
if ( is_entry_subentry( e ) ) {
if( 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 ))
{
/* only subentries are visible */
goto loop_continue;
}
+
} else if ( get_subentries_visibility( op )) {
/* only subentries are visible */
goto loop_continue;
}
+#endif
#ifdef BDB_ALIASES
if ( deref & LDAP_DEREF_SEARCHING && is_entry_alias( e ) ) {
ID *ids )
{
int rc;
- Filter f, scopef, sf, rf, xf;
+ Filter f, scopef, rf, xf;
ID tmp[BDB_IDL_UM_SIZE];
AttributeAssertion aa_ref;
+#ifdef BDB_SUBENTRIES
+ Filter sf;
AttributeAssertion aa_subentry;
- struct bdb_info *bdb = (struct bdb_info *) be->be_private;
+#endif
#ifdef BDB_ALIASES
Filter af;
AttributeAssertion aa_alias;
#endif
+ struct bdb_info *bdb = (struct bdb_info *) be->be_private;
/*
* This routine takes as input a filter (user-filter)
scopef.f_dn = &e->e_nname;
scopef.f_next = xf.f_or == filter ? filter : &xf ;
+#ifdef BDB_SUBENTRIES
if( get_subentries_visibility( op ) ) {
struct berval bv_subentry = { sizeof("SUBENTRY")-1, "SUBENTRY" };
sf.f_choice = LDAP_FILTER_EQUALITY;
sf.f_next = scopef.f_next;
scopef.f_next = &sf;
}
+#endif
-#ifdef BDB_FILTER_INDICES
rc = bdb_filter_candidates( be, &f, ids, tmp );
-#else
- /* FIXME: Original code:
- BDB_IDL_ID( bdb, ids, e->e_id );
- * this is a hack to make "" base work; when bdb_filter_candidates
- * is used this should not be needed any more */
- BDB_IDL_ID( bdb, ids, (e->e_id == NOID ? 1 : e->e_id) );
- rc = 0;
-#endif
Debug(LDAP_DEBUG_TRACE,
"bdb_search_candidates: id=%ld first=%ld last=%ld\n",