Modifications *mods = NULL;
const char *text;
int rc = LDAP_SUCCESS;
+ int manageDSAit;
Debug( LDAP_DEBUG_TRACE, "do_add\n", 0, 0, 0 );
goto done;
}
+ manageDSAit = get_manageDSAit( op ) &&
+ is_entry_referral( e );
+
/*
* 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.
*/
- be = select_backend( e->e_ndn );
+ be = select_backend( e->e_ndn, manageDSAit );
if ( be == NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
}
Backend *
-select_backend( const char * dn )
+select_backend(
+ const char * dn,
+ int manageDSAit )
{
int i, j, len, dnlen;
+ Backend *be = NULL;
dnlen = strlen( dn );
for ( i = 0; i < nbackends; i++ ) {
}
if ( strcmp( backends[i].be_nsuffix[j],
- dn + (dnlen - len) ) == 0 ) {
- return( &backends[i] );
+ dn + (dnlen - len) ) == 0 )
+ {
+ if( be == NULL ) {
+ be = &backends[i];
+
+ if( manageDSAit && len == dnlen ) {
+ continue;
+ }
+ } else {
+ be = &backends[i];
+ }
+ return be;
}
}
}
- return( NULL );
+ return be;
}
int
if( strcmp( target->e_ndn, gr_ndn ) != 0 ) {
/* we won't attempt to send it to a different backend */
- be = select_backend(gr_ndn);
+ be = select_backend(gr_ndn, 0);
if (be == NULL) {
return LDAP_NO_SUCH_OBJECT;
if( target == NULL || strcmp( target->e_ndn, e_ndn ) != 0 ) {
/* we won't attempt to send it to a different backend */
- be = select_backend(e_ndn);
+ be = select_backend(e_ndn, 0);
if (be == NULL) {
return LDAP_NO_SUCH_OBJECT;
* if we don't hold it.
*/
- if ( (be = select_backend( ndn )) == NULL ) {
+ if ( (be = select_backend( ndn, 0 )) == NULL ) {
if ( default_referral ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
Backend *be;
int rc = LDAP_SUCCESS;
const char *text = NULL;
+ int manageDSAit;
ava.aa_desc = NULL;
desc.bv_val = NULL;
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.
*/
- if ( (be = select_backend( ndn )) == NULL ) {
+ if ( (be = select_backend( ndn, manageDSAit )) == NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
rc = 1;
Debug( LDAP_DEBUG_ANY,
"%s: line %d: suffix line must appear inside a database definition (ignored)\n",
fname, lineno, 0 );
- } else if ( ( tmp_be = select_backend( cargv[1] ) ) == be ) {
+ } else if ( ( tmp_be = select_backend( cargv[1], 0 ) ) == be ) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: suffix already served by this backend (ignored)\n",
fname, lineno, 0 );
"%s: line %d: suffixAlias line"
" must appear inside a database definition (ignored)\n",
fname, lineno, 0 );
- } else if ( (tmp_be = select_backend( cargv[1] )) != NULL ) {
+ } else if ( (tmp_be = select_backend( cargv[1], 0 )) != NULL ) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: suffixAlias served by"
" a preceeding backend \"%s\" (ignored)\n",
fname, lineno, tmp_be->be_suffix[0] );
- } else if ( (tmp_be = select_backend( cargv[2] )) != NULL ) {
+ } else if ( (tmp_be = select_backend( cargv[2], 0 )) != NULL ) {
Debug( LDAP_DEBUG_ANY,
"%s: line %d: suffixAlias derefs to differnet backend"
" a preceeding backend \"%s\" (ignored)\n",
const char *text;
Backend *be;
int rc;
+ int manageDSAit;
Debug( LDAP_DEBUG_TRACE, "do_delete\n", 0, 0, 0 );
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d DEL dn=\"%s\"\n",
op->o_connid, op->o_opid, dn, 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.
*/
- if ( (be = select_backend( ndn )) == NULL ) {
+ if ( (be = select_backend( ndn, manageDSAit )) == NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
goto cleanup;
Backend *be;
int rc;
const char *text;
+ int manageDSAit;
Debug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 );
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d MOD dn=\"%s\"\n",
op->o_connid, op->o_opid, dn, 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.
*/
- if ( (be = select_backend( ndn )) == NULL ) {
+ if ( (be = select_backend( ndn, manageDSAit )) == NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
goto cleanup;
ber_len_t length;
int rc;
const char *text;
+ int manageDSAit;
Debug( LDAP_DEBUG_TRACE, "do_modrdn\n", 0, 0, 0 );
Statslog( LDAP_DEBUG_STATS, "conn=%ld op=%d MODRDN dn=\"%s\"\n",
op->o_connid, op->o_opid, dn, 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.
*/
-
- if ( (be = select_backend( ndn )) == NULL ) {
+ if ( (be = select_backend( ndn, manageDSAit )) == NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
goto cleanup;
* the same backend, otherwise we return an error.
*/
if( newSuperior != NULL ) {
- newSuperior_be = select_backend( nnewSuperior );
+ newSuperior_be = select_backend( nnewSuperior, 0 );
if ( newSuperior_be != be ) {
/* newSuperior is in same backend */
LDAP_SLAPD_F (BackendInfo *) backend_info LDAP_P(( const char *type ));
LDAP_SLAPD_F (BackendDB *) backend_db_init LDAP_P(( const char *type ));
-LDAP_SLAPD_F (BackendDB *) select_backend LDAP_P(( const char * dn ));
+LDAP_SLAPD_F (BackendDB *) select_backend LDAP_P((
+ const char * dn,
+ int manageDSAit ));
LDAP_SLAPD_F (int) be_issuffix LDAP_P(( Backend *be, const char *suffix ));
LDAP_SLAPD_F (int) be_isroot LDAP_P(( Backend *be, const char *ndn ));
"slap_sasl2dn: performing internal search (base=%s, scope=%d)\n",
searchbase, scope, 0 );
- be = select_backend( searchbase );
+ be = select_backend( searchbase, 0 );
if(( be == NULL ) || ( be->be_search == NULL))
goto FINISHED;
searchbase = suffix_alias( be, searchbase );
"slap_sasl_match: performing internal search (base=%s, scope=%d)\n",
searchbase, scope, 0 );
- be = select_backend( searchbase );
+ be = select_backend( searchbase, 0 );
if(( be == NULL ) || ( be->be_search == NULL)) {
rc = LDAP_INAPPROPRIATE_AUTH;
goto CONCLUDED;
Backend *be;
int rc;
const char *text;
+ int manageDSAit;
Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 );
LDAP_LOG(( "operation", LDAP_LEVEL_ENTRY, "conn: %d do_search\n",
nbase = ch_strdup( default_search_nbase );
}
+ 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.
*/
- if ( (be = select_backend( nbase )) == NULL ) {
+ if ( (be = select_backend( nbase, manageDSAit )) == NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
}
/* check backend */
- if( select_backend( e->e_ndn ) != be ) {
+ if( select_backend( e->e_ndn, is_entry_referral(e) ) != be )
+ {
fprintf( stderr, "%s: database (%s) not configured to "
"hold dn=\"%s\" (line=%d)\n",
progname,
exit( EXIT_FAILURE );
}
- be = select_backend( tbase );
+ be = select_backend( tbase, 0 );
free( tbase );
if( be == NULL ) {