From 88cbe052e079d3a4ee0848e2442fd92821744a30 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 13 Jul 2007 03:18:20 +0000 Subject: [PATCH] Fallout from ITS#4986 - remove unused param of select_backend() --- servers/slapd/acl.c | 4 ++-- servers/slapd/add.c | 7 ++----- servers/slapd/back-meta/config.c | 8 ++++---- servers/slapd/back-monitor/init.c | 2 +- servers/slapd/back-relay/config.c | 2 +- servers/slapd/back-relay/init.c | 2 +- servers/slapd/back-relay/op.c | 6 +++--- servers/slapd/back-sql/search.c | 2 +- servers/slapd/backend.c | 11 +++++------ servers/slapd/bconfig.c | 4 ++-- servers/slapd/bind.c | 2 +- servers/slapd/compare.c | 5 +---- servers/slapd/delete.c | 7 ++----- servers/slapd/modify.c | 7 ++----- servers/slapd/modrdn.c | 11 ++++------- servers/slapd/overlays/accesslog.c | 4 ++-- servers/slapd/overlays/dds.c | 4 ++-- servers/slapd/overlays/dynlist.c | 6 +++--- servers/slapd/overlays/refint.c | 4 ++-- servers/slapd/passwd.c | 4 ++-- servers/slapd/proto-slap.h | 1 - servers/slapd/sasl.c | 6 +++--- servers/slapd/saslauthz.c | 4 ++-- servers/slapd/search.c | 8 +------- servers/slapd/slapadd.c | 2 +- servers/slapd/slapcommon.c | 2 +- servers/slapd/slapi/slapi_ops.c | 2 +- servers/slapd/slapi/slapi_overlay.c | 2 +- servers/slapd/slapi/slapi_pblock.c | 4 ++-- servers/slapd/slapi/slapi_utils.c | 10 +++++----- servers/slapd/syncrepl.c | 2 +- 31 files changed, 61 insertions(+), 84 deletions(-) diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index b58992fe04..14cc43894f 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -304,7 +304,7 @@ fe_access_allowed( 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; } @@ -2111,7 +2111,7 @@ acl_set_gather( SetCookie *cookie, struct berval *name, AttributeDescription *de 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; diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 02b721f325..3cbd561efe 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -220,21 +220,18 @@ 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, @@ -257,7 +254,7 @@ fe_op_add( Operation *op, SlapReply *rs ) /* 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 */ diff --git a/servers/slapd/back-meta/config.c b/servers/slapd/back-meta/config.c index d90e40ec25..0725a415d6 100644 --- a/servers/slapd/back-meta/config.c +++ b/servers/slapd/back-meta/config.c @@ -283,7 +283,7 @@ meta_back_db_config( * 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: of URI does not refer to current backend" " in \"uri ://[:port]/\" line\n", @@ -294,7 +294,7 @@ meta_back_db_config( /* * 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: of URI does not resolve to a backend" " in \"uri ://[:port]/\" line\n", @@ -1275,7 +1275,7 @@ idassert-authzFrom "dn:" 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" @@ -1297,7 +1297,7 @@ idassert-authzFrom "dn:" } #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" diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index f45ee21bcb..64926717ac 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -2099,7 +2099,7 @@ monitor_back_db_init( 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; diff --git a/servers/slapd/back-relay/config.c b/servers/slapd/back-relay/config.c index 503da6e940..502bfae461 100644 --- a/servers/slapd/back-relay/config.c +++ b/servers/slapd/back-relay/config.c @@ -135,7 +135,7 @@ relay_back_db_config( 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: " diff --git a/servers/slapd/back-relay/init.c b/servers/slapd/back-relay/init.c index c8219e1e20..3b29726a8f 100644 --- a/servers/slapd/back-relay/init.c +++ b/servers/slapd/back-relay/init.c @@ -97,7 +97,7 @@ relay_back_db_open( Backend *be ) 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 ); diff --git a/servers/slapd/back-relay/op.c b/servers/slapd/back-relay/op.c index 2a6d669a73..e3a40db3a3 100644 --- a/servers/slapd/back-relay/op.c +++ b/servers/slapd/back-relay/op.c @@ -61,7 +61,7 @@ relay_back_select_backend( Operation *op, SlapReply *rs, int err, int dosend ) 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, @@ -483,7 +483,7 @@ relay_back_entry_release_rw( Operation *op, Entry *e, int rw ) 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; } @@ -511,7 +511,7 @@ relay_back_entry_get_rw( Operation *op, struct berval *ndn, 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; } diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index 5cb2c38a53..fa0658f2d2 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -2473,7 +2473,7 @@ send_results:; 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; diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index f072400eb3..c18e7d3b63 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -624,7 +624,6 @@ be_db_close( void ) Backend * select_backend( struct berval * dn, - int manageDSAit, int noSubs ) { int j; @@ -1263,7 +1262,7 @@ fe_acl_group( 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 || @@ -1381,7 +1380,7 @@ fe_acl_group( 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; @@ -1500,7 +1499,7 @@ fe_acl_attribute( 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; @@ -1653,7 +1652,7 @@ backend_access( 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; @@ -1775,7 +1774,7 @@ fe_aux_operational( 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 ) diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index d7b94cef5d..94bb341727 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -2117,7 +2117,7 @@ config_suffix(ConfigArgs *c) 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); @@ -2202,7 +2202,7 @@ config_rootpw(ConfigArgs *c) { 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] ); diff --git a/servers/slapd/bind.c b/servers/slapd/bind.c index 706cc43559..b8a506aab3 100644 --- a/servers/slapd/bind.c +++ b/servers/slapd/bind.c @@ -357,7 +357,7 @@ fe_op_bind( Operation *op, SlapReply *rs ) * 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; diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index 230602895a..3683087a29 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -136,7 +136,6 @@ int fe_op_compare( Operation *op, SlapReply *rs ) { Entry *entry = NULL; - int manageDSAit; AttributeAssertion ava = *op->orc_ava; BackendDB *bd = op->o_bd; @@ -201,14 +200,12 @@ fe_op_compare( Operation *op, SlapReply *rs ) 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 ); diff --git a/servers/slapd/delete.c b/servers/slapd/delete.c index 183066b7d6..2f9c1a0b0e 100644 --- a/servers/slapd/delete.c +++ b/servers/slapd/delete.c @@ -107,17 +107,14 @@ int 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, @@ -139,7 +136,7 @@ fe_op_delete( Operation *op, SlapReply *rs ) /* 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 */ diff --git a/servers/slapd/modify.c b/servers/slapd/modify.c index bb0f32e02c..d4180770f7 100644 --- a/servers/slapd/modify.c +++ b/servers/slapd/modify.c @@ -129,7 +129,6 @@ fe_op_modify( Operation *op, SlapReply *rs ) #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 ); @@ -209,14 +208,12 @@ fe_op_modify( Operation *op, SlapReply *rs ) } #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, @@ -243,7 +240,7 @@ fe_op_modify( Operation *op, SlapReply *rs ) /* 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 */ diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index 221a20e8d9..067dd4c527 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -214,7 +214,6 @@ int 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; @@ -237,14 +236,12 @@ fe_op_modrdn( Operation *op, SlapReply *rs ) 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, @@ -266,7 +263,7 @@ fe_op_modrdn( Operation *op, SlapReply *rs ) /* 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 */ @@ -284,7 +281,7 @@ fe_op_modrdn( Operation *op, SlapReply *rs ) * 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 */ @@ -341,7 +338,7 @@ fe_op_modrdn( Operation *op, SlapReply *rs ) } } 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; diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index ef6a46d4a7..4325c8f617 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -767,7 +767,7 @@ log_cf_gen(ConfigArgs *c) 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", @@ -1616,7 +1616,7 @@ accesslog_db_open( 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 ); } diff --git a/servers/slapd/overlays/dds.c b/servers/slapd/overlays/dds.c index 5235a83621..008ec22b10 100644 --- a/servers/slapd/overlays/dds.c +++ b/servers/slapd/overlays/dds.c @@ -140,7 +140,7 @@ dds_expire( void *ctx, dds_info_t *di ) 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 ]; @@ -1785,7 +1785,7 @@ slap_exop_refresh( 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" ); diff --git a/servers/slapd/overlays/dynlist.c b/servers/slapd/overlays/dynlist.c index 18edb952c4..eb6fc7a564 100644 --- a/servers/slapd/overlays/dynlist.c +++ b/servers/slapd/overlays/dynlist.c @@ -477,7 +477,7 @@ dynlist_prepare_entry( Operation *op, SlapReply *rs, dynlist_info_t *dli ) 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 ); @@ -586,7 +586,7 @@ dynlist_compare( Operation *op, SlapReply *rs ) 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 ); @@ -615,7 +615,7 @@ dynlist_compare( Operation *op, SlapReply *rs ) 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; } diff --git a/servers/slapd/overlays/refint.c b/servers/slapd/overlays/refint.c index 1d1b28723e..c62c39bd52 100644 --- a/servers/slapd/overlays/refint.c +++ b/servers/slapd/overlays/refint.c @@ -520,7 +520,7 @@ refint_qtask( void *ctx, void *arg ) 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", @@ -677,7 +677,7 @@ refint_response( ** */ - db = select_backend(&id->dn, 0, 1); + db = select_backend(&id->dn, 1); if(db) { if (!db->be_search || !db->be_modify) { diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 1d69910bae..a08bbba4b2 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -101,7 +101,7 @@ int passwd_extop( 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 ); @@ -136,7 +136,7 @@ int passwd_extop( /* 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, diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 835c37f1d4..8d15e80496 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -335,7 +335,6 @@ LDAP_SLAPD_F (void) backend_db_move LDAP_P((BackendDB *bd, int idx)); 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, diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index 7b43c706d4..beeead411b 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -326,7 +326,7 @@ slap_auxprop_lookup( 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 */ @@ -440,7 +440,7 @@ slap_auxprop_store( } 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; @@ -1098,7 +1098,7 @@ slapd_rw_apply( void *private, const char *filter, struct berval *val ) 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; } diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index 2f6fd33d48..f591668961 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -1820,7 +1820,7 @@ exact_match: "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; @@ -1953,7 +1953,7 @@ slap_sasl2dn( } /* 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: diff --git a/servers/slapd/search.c b/servers/slapd/search.c index f53584a9e8..828c1fc70c 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -239,12 +239,8 @@ return_results:; 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; @@ -320,9 +316,7 @@ fe_op_search( Operation *op, SlapReply *rs ) * 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 ); diff --git a/servers/slapd/slapadd.c b/servers/slapd/slapadd.c index a39ad0b9f4..69f2a59b11 100644 --- a/servers/slapd/slapadd.c +++ b/servers/slapd/slapadd.c @@ -144,7 +144,7 @@ slapadd( int argc, char **argv ) } /* 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: " diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index 22a5593c00..188d4c73e5 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -613,7 +613,7 @@ slap_tool_init( exit( EXIT_FAILURE ); } - be = select_backend( &nbase, 0, 0 ); + be = select_backend( &nbase, 0 ); ber_memfree( nbase.bv_val ); switch ( tool ) { diff --git a/servers/slapd/slapi/slapi_ops.c b/servers/slapd/slapi/slapi_ops.c index 0d31168fba..fe1d2474c6 100644 --- a/servers/slapd/slapi/slapi_ops.c +++ b/servers/slapd/slapi/slapi_ops.c @@ -296,7 +296,7 @@ slapi_int_set_operation_dn( Slapi_PBlock *pb ) 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 ); diff --git a/servers/slapd/slapi/slapi_overlay.c b/servers/slapd/slapi/slapi_overlay.c index fcbe435643..b36f5a749f 100644 --- a/servers/slapd/slapi/slapi_overlay.c +++ b/servers/slapd/slapi/slapi_overlay.c @@ -763,7 +763,7 @@ slapi_over_acl_group( 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 || diff --git a/servers/slapd/slapi/slapi_pblock.c b/servers/slapd/slapi/slapi_pblock.c index 2414ce5ed6..136a5586b1 100644 --- a/servers/slapd/slapi/slapi_pblock.c +++ b/servers/slapd/slapi/slapi_pblock.c @@ -447,7 +447,7 @@ pblock_be_call( Slapi_PBlock *pb, int (*bep)(Operation *) ) 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; @@ -526,7 +526,7 @@ pblock_get( Slapi_PBlock *pb, int param, void **value ) 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 ); diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 6feae2bf7b..99d5ccbc33 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -478,7 +478,7 @@ slapi_entry_has_children( const Slapi_Entry *e ) 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 ); } @@ -946,7 +946,7 @@ int slapi_dn_isbesuffix( Slapi_PBlock *pb, char *ldn ) 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; } @@ -983,7 +983,7 @@ char *slapi_dn_beparent( Slapi_PBlock *pb, const char *ldn ) 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 ); @@ -3116,7 +3116,7 @@ int slapi_entry_schema_check( Slapi_PBlock *pb, Slapi_Entry *e ) 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 ); @@ -3402,7 +3402,7 @@ Slapi_Backend *slapi_be_select( const Slapi_DN *sdn ) slapi_sdn_get_ndn( sdn ); - be = select_backend( (struct berval *)&sdn->ndn, 0, 0 ); + be = select_backend( (struct berval *)&sdn->ndn, 0 ); return be; } diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 85389e74c0..7b49e6eda7 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -1141,7 +1141,7 @@ do_syncrepl( /* 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; } -- 2.39.5