intercept. Now a single syncprov works over the entire glued context.
* appropriate one, or send a referral to our "referral server"
* if we don't hold it.
*/
- op->o_bd = select_backend( &e->e_nname, manageDSAit, 0 );
+ op->o_bd = select_backend( &e->e_nname, manageDSAit, 1 );
if ( op->o_bd == NULL ) {
rs->sr_ref = referral_rewrite( default_referral,
NULL, &e->e_name, LDAP_SCOPE_DEFAULT );
slap_overinfo *oi = op->o_bd->bd_info->bi_private;
slap_overinst *on = oi->oi_list;
BI_op_bind **func;
- BackendDB *be = op->o_bd, db = *op->o_bd;
+ BackendDB *be = op->o_bd, db;
slap_callback cb = {NULL, over_back_response, NULL, NULL};
int rc = SLAP_CB_CONTINUE;
- db.be_flags |= SLAP_DBFLAG_OVERLAY;
- op->o_bd = &db;
+ if ( !SLAP_ISOVERLAY( op->o_bd )) {
+ db = *op->o_bd;
+ db.be_flags |= SLAP_DBFLAG_OVERLAY;
+ op->o_bd = &db;
+ }
cb.sc_next = op->o_callback;
cb.sc_private = oi;
op->o_callback = &cb;
* 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, manageDSAit, 1 );
if ( op->o_bd == NULL ) {
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
* 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, manageDSAit, 1 );
if ( op->o_bd == NULL ) {
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
* 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, manageDSAit, 1 );
if ( op->o_bd == NULL ) {
rs->sr_ref = referral_rewrite( default_referral,
NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
return 0;
}
+enum glue_which {
+ op_modify = 0,
+ op_modrdn,
+ op_add,
+ op_delete
+};
+
+static int
+glue_op_func ( Operation *op, SlapReply *rs )
+{
+ slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
+ glueinfo *gi = (glueinfo *)on->on_bi.bi_private;
+ BackendDB *b0 = op->o_bd;
+ BackendInfo *bi0 = op->o_bd->bd_info;
+ BI_op_modify **func;
+ enum glue_which which;
+ int rc;
+
+ op->o_bd = glue_back_select (b0, &op->o_req_ndn);
+ b0->bd_info = on->on_info->oi_orig;
+
+ switch(op->o_tag) {
+ case LDAP_REQ_ADD: which = op_add; break;
+ case LDAP_REQ_DELETE: which = op_delete; break;
+ case LDAP_REQ_MODIFY: which = op_modify; break;
+ case LDAP_REQ_MODRDN: which = op_modrdn; break;
+ }
+
+ func = &op->o_bd->bd_info->bi_op_modify;
+ if ( func[which] )
+ rc = func[which]( op, rs );
+ else
+ rc = SLAP_CB_CONTINUE;
+
+ op->o_bd = b0;
+ op->o_bd->bd_info = bi0;
+ return rc;
+}
+
static int
glue_op_search ( Operation *op, SlapReply *rs )
{
case LDAP_SCOPE_SUBORDINATE: /* FIXME */
#endif
+#if 0
if ( op->o_sync ) {
if (op->o_bd && op->o_bd->be_search) {
rs->sr_err = op->o_bd->be_search( op, rs );
}
return rs->sr_err;
}
+#endif
op->o_callback = &cb;
rs->sr_err = gs.err = LDAP_UNWILLING_TO_PERFORM;
glue.on_bi.bi_db_destroy = glue_db_destroy;
glue.on_bi.bi_op_search = glue_op_search;
+ glue.on_bi.bi_op_modify = glue_op_func;
+ glue.on_bi.bi_op_modrdn = glue_op_func;
+ glue.on_bi.bi_op_add = glue_op_func;
+ glue.on_bi.bi_op_delete = glue_op_func;
return overlay_register( &glue );
}
rc = rs->sr_err;
goto error_return;
}
- op->o_bd = select_backend( &op->o_req_ndn, 0, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, 0, 1 );
} else {
ber_dupbv_x( &op->o_req_dn, &op->o_dn, op->o_tmpmemctx );
manageDsaIt = isCritical ? SLAP_CONTROL_CRITICAL : SLAP_CONTROL_NONCRITICAL;
}
- op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 1 );
if ( op->o_bd == NULL ) {
rs.sr_err = LDAP_PARTIAL_RESULTS;
goto cleanup;
pPB = (Slapi_PBlock *)op->o_pb;
op->o_ctrls = controls;
- op->o_bd = select_backend( &((*e)->e_nname), manageDsaIt, 0 );
+ op->o_bd = select_backend( &((*e)->e_nname), manageDsaIt, 1 );
if ( op->o_bd == NULL ) {
rs.sr_err = LDAP_PARTIAL_RESULTS;
goto cleanup;
manageDsaIt = isCritical ? SLAP_CONTROL_CRITICAL : SLAP_CONTROL_NONCRITICAL;
}
- op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 1 );
if ( op->o_bd == NULL ) {
rs.sr_err = LDAP_PARTIAL_RESULTS;
goto cleanup;
manageDsaIt = isCritical ? SLAP_CONTROL_CRITICAL : SLAP_CONTROL_NONCRITICAL;
}
- op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 1 );
if ( op->o_bd == NULL ) {
rs.sr_err = LDAP_PARTIAL_RESULTS;
goto cleanup;
manageDsaIt = isCritical ? SLAP_CONTROL_CRITICAL : SLAP_CONTROL_NONCRITICAL;
}
- op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 0 );
+ op->o_bd = select_backend( &op->o_req_ndn, manageDsaIt, 1 );
if ( op->o_bd == NULL ) {
if ( manageDsaIt > SLAP_CONTROL_NONE ) {
rs.sr_err = LDAP_NO_SUCH_OBJECT;