Skip to content
Snippets Groups Projects
Commit ed0949c7 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

work out an issue with chk_referrals and back-relay/rwm; this looks like the best compromise

parent 7e310a62
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,9 @@ relay_back_initialize( BackendInfo *bi )
bi->bi_db_init = relay_back_db_init;
bi->bi_db_config = relay_back_db_config;
bi->bi_db_open = relay_back_db_open;
bi->bi_db_close = 0 /* relay_back_db_close */ ;
#if 0
bi->bi_db_close =relay_back_db_close;
#endif
bi->bi_db_destroy = relay_back_db_destroy;
bi->bi_op_bind = relay_back_op_bind;
......@@ -48,12 +50,16 @@ relay_back_initialize( BackendInfo *bi )
bi->bi_op_modrdn = relay_back_op_modrdn;
bi->bi_op_add = relay_back_op_add;
bi->bi_op_delete = relay_back_op_delete;
bi->bi_op_abandon = 0 /* relay_back_op_abandon */ ;
#if 0 /* causes a deadlock */
bi->bi_op_abandon = relay_back_op_abandon;
#endif
bi->bi_op_cancel = relay_back_op_cancel;
bi->bi_extended = relay_back_op_extended;
bi->bi_entry_release_rw = relay_back_entry_release_rw;
bi->bi_entry_get_rw = relay_back_entry_get_rw;
#if 0 /* see comment in op.c */
bi->bi_chk_referrals = relay_back_chk_referrals;
#endif
bi->bi_operational = relay_back_operational;
bi->bi_has_subordinates = relay_back_has_subordinates;
......
......@@ -522,6 +522,13 @@ relay_back_entry_get_rw( struct slap_op *op, struct berval *ndn,
}
/*
* NOTE: even the existence of this function is questionable: we cannot
* pass the bi_chk_referrals() call thru the rwm overlay because there
* is no way to rewrite the req_dn back; but then relay_back_chk_referrals()
* is passing the target database a DN that likely does not belong to its
* naming context... mmmh.
*/
int
relay_back_chk_referrals( struct slap_op *op, struct slap_rep *rs )
{
......@@ -529,10 +536,22 @@ relay_back_chk_referrals( struct slap_op *op, struct slap_rep *rs )
int rc = 0;
bd = relay_back_select_backend( op, rs, LDAP_SUCCESS );
/* FIXME: this test only works if there are no overlays, so
* it is nearly useless; if made stricter, no nested back-relays
* can be instantiated... too bad. */
if ( bd == NULL || bd == op->o_bd ) {
return 0;
}
/* no nested back-relays... */
if ( overlay_is_over( bd ) ) {
slap_overinfo *oi = (slap_overinfo *)bd->bd_info->bi_private;
if ( oi->oi_orig == op->o_bd->bd_info ) {
return 0;
}
}
if ( bd->be_chk_referrals ) {
BackendDB *be = op->o_bd;
slap_callback cb;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment