Commit 88cbe052 authored by Howard Chu's avatar Howard Chu
Browse files

Fallout from ITS#4986 - remove unused param of select_backend()

parent 974ca7b3
......@@ -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;
......
......@@ -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 */
......
......@@ -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: <naming context> of URI does not refer to current backend"
" in \"uri <protocol>://<server>[:port]/<naming context>\" 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: <naming context> of URI does not resolve to a backend"
" in \"uri <protocol>://<server>[:port]/<naming context>\" line\n",
......@@ -1275,7 +1275,7 @@ idassert-authzFrom "dn:<rootdn>"
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:<rootdn>"
}
#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"
......
......@@ -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;
......
......@@ -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: "
......
......@@ -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 );
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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 )
......
......@@ -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] );
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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;
......
......@@ -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 );
}
......
......@@ -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" );
......
......@@ -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;
}
......
......@@ -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) {
......
......@@ -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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment