be_orig = op->o_bd;
if ( op->o_bd == NULL ) {
- op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
if ( op->o_bd == NULL )
op->o_bd = frontendDB;
}
goto url_done;
}
- op2.o_bd = select_backend( &op2.o_req_ndn, 0, 1 );
+ op2.o_bd = select_backend( &op2.o_req_ndn, 1 );
if ( ( op2.o_bd == NULL ) || ( op2.o_bd->be_search == NULL ) ) {
rc = LDAP_NO_SUCH_OBJECT;
goto url_done;
int
fe_op_add( Operation *op, SlapReply *rs )
{
- int manageDSAit;
Modifications **modtail = &op->ora_modlist;
int rc = 0;
BackendDB *op_be, *bd = op->o_bd;
char textbuf[ SLAP_TEXT_BUFLEN ];
size_t textlen = sizeof( textbuf );
- manageDSAit = get_manageDSAit( op );
-
/*
* We could be serving multiple database backends. Select the
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
- op->o_bd = select_backend( &op->ora_e->e_nname, manageDSAit, 1 );
+ op->o_bd = select_backend( &op->ora_e->e_nname, 1 );
if ( op->o_bd == NULL ) {
op->o_bd = bd;
rs->sr_ref = referral_rewrite( default_referral,
/* If we've got a glued backend, check the real backend */
op_be = op->o_bd;
if ( SLAP_GLUE_INSTANCE( op->o_bd )) {
- op->o_bd = select_backend( &op->ora_e->e_nname, manageDSAit, 0 );
+ op->o_bd = select_backend( &op->ora_e->e_nname, 0 );
}
/* check restrictions */
* uri MUST be a branch of suffix!
*/
#if 0 /* too strict a constraint */
- if ( select_backend( &mt->mt_nsuffix, 0, 0 ) != be ) {
+ if ( select_backend( &mt->mt_nsuffix, 0 ) != be ) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: <naming context> of URI does not refer to current backend"
" in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
/*
* uri MUST be a branch of a suffix!
*/
- if ( select_backend( &mt->mt_nsuffix, 0, 0 ) == NULL ) {
+ if ( select_backend( &mt->mt_nsuffix, 0 ) == NULL ) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: <naming context> of URI does not resolve to a backend"
" in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
return 1;
}
- tmp_be = select_backend( &nvnc, 0, 0 );
+ tmp_be = select_backend( &nvnc, 0 );
if ( tmp_be != NULL && tmp_be != be ) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: suffix already in use by another backend in"
}
#if 0
- tmp_be = select_backend( &nrnc, 0, 0 );
+ tmp_be = select_backend( &nrnc, 0 );
if ( tmp_be != NULL ) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: massaged suffix already in use by another backend in"
be->be_private = &monitor_info;
- be2 = select_backend( &ndn, 0, 0 );
+ be2 = select_backend( &ndn, 0 );
if ( be2 != be ) {
char *type = be2->bd_info->bi_type;
return 1;
}
- bd = select_backend( &ndn, 0, 1 );
+ bd = select_backend( &ndn, 1 );
if ( bd == NULL ) {
Log3( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
"%s: line %d: "
assert( ri != NULL );
if ( !BER_BVISNULL( &ri->ri_realsuffix ) ) {
- ri->ri_bd = select_backend( &ri->ri_realsuffix, 0, 1 );
+ ri->ri_bd = select_backend( &ri->ri_realsuffix, 1 );
/* must be there: it was during config! */
assert( ri->ri_bd != NULL );
BackendDB *bd = ri->ri_bd;
if ( bd == NULL && !BER_BVISNULL( &op->o_req_ndn ) ) {
- bd = select_backend( &op->o_req_ndn, 0, 1 );
+ bd = select_backend( &op->o_req_ndn, 1 );
if ( bd == op->o_bd ) {
if ( err > LDAP_SUCCESS && dosend ) {
send_ldap_error( op, rs,
bd = ri->ri_bd;
if ( bd == NULL) {
- bd = select_backend( &op->o_req_ndn, 0, 1 );
+ bd = select_backend( &op->o_req_ndn, 1 );
if ( bd == NULL ) {
return 1;
}
bd = ri->ri_bd;
if ( bd == NULL) {
- bd = select_backend( &op->o_req_ndn, 0, 1 );
+ bd = select_backend( &op->o_req_ndn, 1 );
if ( bd == NULL ) {
return 1;
}
slap_callback cb = { 0 };
op2.o_tag = LDAP_REQ_ADD;
- op2.o_bd = select_backend( &op->o_bd->be_nsuffix[0], 0, 0 );
+ op2.o_bd = select_backend( &op->o_bd->be_nsuffix[0], 0 );
op2.ora_e = e;
op2.o_callback = &cb;
Backend *
select_backend(
struct berval * dn,
- int manageDSAit,
int noSubs )
{
int j;
GroupAssertion *g;
Backend *be = op->o_bd;
- op->o_bd = select_backend( gr_ndn, 0, 0 );
+ op->o_bd = select_backend( gr_ndn, 0 );
for ( g = op->o_groups; g; g = g->ga_next ) {
if ( g->ga_be != op->o_bd || g->ga_oc != group_oc ||
if ( user == NULL ) {
int rc2;
- op->o_bd = select_backend( op_ndn, 0, 0 );
+ op->o_bd = select_backend( op_ndn, 0 );
op->o_private = NULL;
rc2 = be_entry_get_rw( op, op_ndn, NULL, NULL, 0, &user );
user_priv = op->o_private;
AccessControlState acl_state = ACL_STATE_INIT;
Backend *be = op->o_bd;
- op->o_bd = select_backend( edn, 0, 0 );
+ op->o_bd = select_backend( edn, 0 );
if ( target && dn_match( &target->e_nname, edn ) ) {
e = target;
assert( edn != NULL );
assert( access > ACL_NONE );
- op->o_bd = select_backend( edn, 0, 0 );
+ op->o_bd = select_backend( edn, 0 );
if ( target && dn_match( &target->e_nname, edn ) ) {
e = target;
BackendDB *be_orig = op->o_bd;
/* Let the overlays have a chance at this */
- op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
if ( op->o_bd != NULL && !be_match( op->o_bd, frontendDB ) &&
( SLAP_OPATTRS( rs->sr_attr_flags ) || rs->sr_attrs ) &&
op->o_bd->be_operational != NULL )
if (SLAP_DBHIDDEN( c->be ))
tbe = NULL;
else
- tbe = select_backend(&ndn, 0, 0);
+ tbe = select_backend(&ndn, 0);
if(tbe == c->be) {
Debug( LDAP_DEBUG_ANY, "%s: suffix already served by this backend!.\n",
c->log, 0, 0);
return 0;
}
- tbe = select_backend(&c->be->be_rootndn, 0, 0);
+ tbe = select_backend(&c->be->be_rootndn, 0);
if(tbe != c->be) {
snprintf( c->msg, sizeof( c->msg ), "<%s> can only be set when rootdn is under suffix",
c->argv[0] );
* if we don't hold it.
*/
- if ( (op->o_bd = select_backend( &op->o_req_ndn, 0, 0 )) == NULL ) {
+ if ( (op->o_bd = select_backend( &op->o_req_ndn, 0 )) == NULL ) {
/* don't return referral for bind requests */
/* noSuchObject is not allowed to be returned by bind */
rs->sr_err = LDAP_INVALID_CREDENTIALS;
fe_op_compare( Operation *op, SlapReply *rs )
{
Entry *entry = NULL;
- int manageDSAit;
AttributeAssertion ava = *op->orc_ava;
BackendDB *bd = op->o_bd;
goto cleanup;
}
- manageDSAit = get_manageDSAit( op );
-
/*
* We could be serving multiple database backends. Select the
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
- op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
if ( op->o_bd == NULL ) {
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
fe_op_delete( Operation *op, SlapReply *rs )
{
struct berval pdn = BER_BVNULL;
- int manageDSAit;
BackendDB *op_be, *bd = op->o_bd;
- manageDSAit = get_manageDSAit( op );
-
/*
* We could be serving multiple database backends. Select the
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
- op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 1 );
+ op->o_bd = select_backend( &op->o_req_ndn, 1 );
if ( op->o_bd == NULL ) {
op->o_bd = bd;
rs->sr_ref = referral_rewrite( default_referral,
/* If we've got a glued backend, check the real backend */
op_be = op->o_bd;
if ( SLAP_GLUE_INSTANCE( op->o_bd )) {
- op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
}
/* check restrictions */
#ifdef LDAP_DEBUG
Modifications *tmp;
#endif
- int manageDSAit;
BackendDB *op_be, *bd = op->o_bd;
char textbuf[ SLAP_TEXT_BUFLEN ];
size_t textlen = sizeof( textbuf );
}
#endif /* LDAP_DEBUG */
- manageDSAit = get_manageDSAit( op );
-
/*
* We could be serving multiple database backends. Select the
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
- op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 1 );
+ op->o_bd = select_backend( &op->o_req_ndn, 1 );
if ( op->o_bd == NULL ) {
op->o_bd = bd;
rs->sr_ref = referral_rewrite( default_referral,
/* If we've got a glued backend, check the real backend */
op_be = op->o_bd;
if ( SLAP_GLUE_INSTANCE( op->o_bd )) {
- op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
}
/* check restrictions */
fe_op_modrdn( Operation *op, SlapReply *rs )
{
Backend *newSuperior_be = NULL;
- int manageDSAit;
struct berval pdn = BER_BVNULL;
BackendDB *op_be, *bd = op->o_bd;
Statslog( LDAP_DEBUG_STATS, "%s MODRDN dn=\"%s\"\n",
op->o_log_prefix, op->o_req_dn.bv_val, 0, 0, 0 );
- manageDSAit = get_manageDSAit( op );
-
/*
* We could be serving multiple database backends. Select the
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
- op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 1 );
+ op->o_bd = select_backend( &op->o_req_ndn, 1 );
if ( op->o_bd == NULL ) {
op->o_bd = bd;
rs->sr_ref = referral_rewrite( default_referral,
/* If we've got a glued backend, check the real backend */
op_be = op->o_bd;
if ( SLAP_GLUE_INSTANCE( op->o_bd )) {
- op->o_bd = select_backend( &op->o_req_ndn, manageDSAit, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
}
/* check restrictions */
* the same backend, otherwise we return an error.
*/
if( op->orr_newSup ) {
- newSuperior_be = select_backend( op->orr_nnewSup, 0, 0 );
+ newSuperior_be = select_backend( op->orr_nnewSup, 0 );
if ( newSuperior_be != op->o_bd ) {
/* newSuperior is in different backend */
}
}
op->o_managedsait = org_managedsait;
- op->o_dn = org_dn;
+ op->o_dn = org_dn;
op->o_ndn = org_ndn;
op->o_req_dn = org_req_dn;
op->o_req_ndn = org_req_ndn;
switch( c->type ) {
case LOG_DB:
if ( CONFIG_ONLINE_ADD( c )) {
- li->li_db = select_backend( &c->value_ndn, 0, 0 );
+ li->li_db = select_backend( &c->value_ndn, 0 );
if ( !li->li_db ) {
snprintf( c->msg, sizeof( c->msg ),
"<%s> no matching backend found for suffix",
if ( !BER_BVISEMPTY( &li->li_db_suffix )) {
- li->li_db = select_backend( &li->li_db_suffix, 0, 0 );
+ li->li_db = select_backend( &li->li_db_suffix, 0 );
ch_free( li->li_db_suffix.bv_val );
BER_BVZERO( &li->li_db_suffix );
}
op->o_tag = LDAP_REQ_SEARCH;
memset( &op->oq_search, 0, sizeof( op->oq_search ) );
- op->o_bd = select_backend( &di->di_nsuffix[ 0 ], 0, 0 );
+ op->o_bd = select_backend( &di->di_nsuffix[ 0 ], 0 );
op->o_req_dn = op->o_bd->be_suffix[ 0 ];
op->o_req_ndn = op->o_bd->be_nsuffix[ 0 ];
op->o_log_prefix, op->o_req_ndn.bv_val );
op->o_req_dn = op->o_req_ndn;
- op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
if ( !SLAP_DYNAMIC( op->o_bd ) ) {
send_ldap_error( op, rs, LDAP_UNAVAILABLE_CRITICAL_EXTENSION,
"backend does not support dynamic directory services" );
goto cleanup;
}
- o.o_bd = select_backend( &o.o_req_ndn, 0, 1 );
+ o.o_bd = select_backend( &o.o_req_ndn, 1 );
if ( o.o_bd && o.o_bd->be_search ) {
#ifdef SLAP_OPATTRS
r.sr_attr_flags = slap_attr_flags( o.ors_attrs );
op->o_do_not_cache = 1;
op->o_dn = op->o_bd->be_rootdn;
op->o_ndn = op->o_bd->be_rootndn;
- op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
r.sr_err = be_entry_get_rw( op, &op->o_req_ndn,
dli->dli_oc, NULL, 0, &e );
o.ors_tlimit = SLAP_NO_LIMIT;
o.ors_slimit = SLAP_NO_LIMIT;
- o.o_bd = select_backend( &o.o_req_ndn, 0, 1 );
+ o.o_bd = select_backend( &o.o_req_ndn, 1 );
if ( !o.o_bd || !o.o_bd->be_search ) {
return SLAP_CB_CONTINUE;
}
op->o_req_dn = dp->dn;
op->o_req_ndn = dp->ndn;
- op->o_bd = select_backend(&dp->ndn, 0, 1);
+ op->o_bd = select_backend(&dp->ndn, 1);
if(!op->o_bd) {
Debug( LDAP_DEBUG_TRACE,
"refint_response: no backend for DN %s!\n",
**
*/
- db = select_backend(&id->dn, 0, 1);
+ db = select_backend(&id->dn, 1);
if(db) {
if (!db->be_search || !db->be_modify) {
rc = rs->sr_err;
goto error_return;
}
- op->o_bd = select_backend( &op->o_req_ndn, 0, 1 );
+ op->o_bd = select_backend( &op->o_req_ndn, 1 );
} else {
ber_dupbv_x( &op->o_req_dn, &op->o_dn, op->o_tmpmemctx );
/* If we've got a glued backend, check the real backend */
op_be = op->o_bd;
if ( SLAP_GLUE_INSTANCE( op->o_bd )) {
- op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
}
if (backend_check_restrictions( op, rs,
LDAP_SLAPD_F (BackendDB *) select_backend LDAP_P((
struct berval * dn,
- int manageDSAit,
int noSubordinates ));
LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be,
cb.sc_private = &sl;
- op.o_bd = select_backend( &op.o_req_ndn, 0, 1 );
+ op.o_bd = select_backend( &op.o_req_ndn, 1 );
if ( op.o_bd ) {
/* For rootdn, see if we can use the rootpw */
}
if (!conn || !op.o_req_ndn.bv_val) return SASL_BADPARAM;
- op.o_bd = select_backend( &op.o_req_ndn, 0, 1 );
+ op.o_bd = select_backend( &op.o_req_ndn, 1 );
if ( !op.o_bd || !op.o_bd->be_modify ) return SASL_FAIL;
op->o_tag = LDAP_REQ_SEARCH;
op->o_req_dn = op->o_req_ndn = sl->base;
- op->o_bd = select_backend( &op->o_req_ndn, 0, 1 );
+ op->o_bd = select_backend( &op->o_req_ndn, 1 );
if ( !op->o_bd ) {
return REWRITE_ERR;
}
"slap_sasl_match: performing internal search (base=%s, scope=%d)\n",
op.o_req_ndn.bv_val, op.ors_scope, 0 );
- op.o_bd = select_backend( &op.o_req_ndn, 0, 1 );
+ op.o_bd = select_backend( &op.o_req_ndn, 1 );
if(( op.o_bd == NULL ) || ( op.o_bd->be_search == NULL)) {
rc = LDAP_INAPPROPRIATE_AUTH;
goto CONCLUDED;
}
/* Must do an internal search */
- op.o_bd = select_backend( &op.o_req_ndn, 0, 1 );
+ op.o_bd = select_backend( &op.o_req_ndn, 1 );
switch ( op.ors_scope ) {
case LDAP_X_SCOPE_EXACT:
int
fe_op_search( Operation *op, SlapReply *rs )
{
- int manageDSAit;
- int be_manageDSAit;
BackendDB *bd = op->o_bd;
- manageDSAit = get_manageDSAit( op );
-
/* fake while loop to allow breaking out */
while ( op->ors_scope == LDAP_SCOPE_BASE ) {
Entry *entry = NULL;
* if we don't hold it.
*/
- be_manageDSAit = manageDSAit;
-
- op->o_bd = select_backend( &op->o_req_ndn, be_manageDSAit, 1 );
+ op->o_bd = select_backend( &op->o_req_ndn, 1 );
if ( op->o_bd == NULL ) {
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, op->ors_scope );
}
/* check backend */
- if( select_backend( &e->e_nname, is_entry_referral(e), nosubordinates )
+ if( select_backend( &e->e_nname, nosubordinates )
!= be )
{
fprintf( stderr, "%s: line %d: "
exit( EXIT_FAILURE );
}
- be = select_backend( &nbase, 0, 0 );
+ be = select_backend( &nbase, 0 );
ber_memfree( nbase.bv_val );
switch ( tool ) {
if ( BER_BVISNULL( &op->o_ndn ) ) {
/* set to root DN */
- be = select_backend( &op->o_req_ndn, get_manageDSAit( op ), 1 );
+ be = select_backend( &op->o_req_ndn, 1 );
if ( be != NULL ) {
ber_dupbv( &op->o_dn, &be->be_rootdn );
ber_dupbv( &op->o_ndn, &be->be_rootndn );
GroupAssertion *g;
SlapReply rs = { REP_RESULT };
- op->o_bd = select_backend( gr_ndn, 0, 0 );
+ op->o_bd = select_backend( gr_ndn, 0 );
for ( g = op->o_groups; g; g = g->ga_next ) {
if ( g->ga_be != op->o_bd || g->ga_oc != group_oc ||
op = pb->pb_op;
be_orig = op->o_bd;
- op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0 );
rc = (*bep)( op );
op->o_bd = be_orig;
break;
case SLAPI_BACKEND:
PBLOCK_ASSERT_OP( pb, 0 );
- *((BackendDB **)value) = select_backend( &pb->pb_op->o_req_ndn, 0, 0 );
+ *((BackendDB **)value) = select_backend( &pb->pb_op->o_req_ndn, 0 );
break;
case SLAPI_BE_TYPE:
PBLOCK_ASSERT_OP( pb, 0 );
slapi_pblock_set( pb, SLAPI_TARGET_DN, slapi_entry_get_dn( (Entry *)e ) );
- pb->pb_op->o_bd = select_backend( (struct berval *)&e->e_nname, 0, 0 );
+ pb->pb_op->o_bd = select_backend( (struct berval *)&e->e_nname, 0 );
if ( pb->pb_op->o_bd != NULL ) {
pb->pb_op->o_bd->be_has_subordinates( pb->pb_op, (Entry *)e, &hasSubordinates );
}
ndn.bv_len = strlen( ldn );
ndn.bv_val = ldn;
- be = select_backend( &pb->pb_op->o_req_ndn, 0, 0 );
+ be = select_backend( &pb->pb_op->o_req_ndn, 0 );
if ( be == NULL ) {
return 0;
}
return NULL;
}
- be = select_backend( &pb->pb_op->o_req_ndn, 0, 0 );
+ be = select_backend( &pb->pb_op->o_req_ndn, 0 );
if ( be == NULL || be_issuffix( be, &normalizedDN ) == 0 ) {
dnParent( &prettyDN, &parentDN );
be_orig = pb->pb_op->o_bd;
- pb->pb_op->o_bd = select_backend( &e->e_nname, 0, 0 );
+ pb->pb_op->o_bd = select_backend( &e->e_nname, 0 );
if ( pb->pb_op->o_bd != NULL ) {
rc = entry_schema_check( pb->pb_op, e, NULL, 0, 0,
&text, textbuf, textlen );
slapi_sdn_get_ndn( sdn );
- be = select_backend( (struct berval *)&sdn->ndn, 0, 0 );
+ be = select_backend( (struct berval *)&sdn->ndn, 0 );
return be;
}
/* If we're glued, send writes through the glue parent */
if ( !si->si_wbe ) {
if ( SLAP_GLUE_SUBORDINATE( be )) {
- si->si_wbe = select_backend( &be->be_nsuffix[0], 0, 1 );
+ si->si_wbe = select_backend( &be->be_nsuffix[0], 1 );
} else {
si->si_wbe = be;
}