typedef struct syncprov_info_t {
syncops *si_ops;
BerVarray si_ctxcsn; /* ldapsync context */
+ struct berval si_contextdn;
int *si_sids;
int si_numcsns;
int si_chkops; /* checkpointing info */
SlapReply rsm = { 0 };
slap_callback cb = {0};
BackendDB be;
+ struct berval ctxdn;
+
#ifdef CHECK_CSN
Syntax *syn = slap_schema.si_ad_contextCSN->ad_type->sat_syntax;
if ( SLAP_GLUE_SUBORDINATE( op->o_bd )) {
be = *on->on_info->oi_origdb;
opm.o_bd = &be;
+ ctxdn = be.be_nsuffix[0];
+ } else {
+ ctxdn = si->si_contextdn;
}
- opm.o_req_dn = opm.o_bd->be_suffix[0];
- opm.o_req_ndn = opm.o_bd->be_nsuffix[0];
+ opm.o_req_dn = ctxdn;
+ opm.o_req_ndn = ctxdn;
opm.o_bd->bd_info = on->on_info->oi_orig;
opm.o_managedsait = SLAP_CONTROL_NONCRITICAL;
opm.o_no_schema_check = 1;
* it will deadlock
*/
if ( op->o_tag != LDAP_REQ_ADD ||
- !dn_match( &op->o_req_ndn, &op->o_bd->be_nsuffix[0] )) {
+ !dn_match( &op->o_req_ndn, &si->si_contextdn )) {
if ( si->si_chkops && si->si_numops >= si->si_chkops ) {
do_check = 1;
si->si_numops = 0;
syncprov_info_t *si = on->on_bi.bi_private;
int rc = SLAP_CB_CONTINUE;
- if ( dn_match( &op->o_req_ndn, op->o_bd->be_nsuffix ) &&
+ if ( dn_match( &op->o_req_ndn, &si->si_contextdn ) &&
op->oq_compare.rs_ava->aa_desc == slap_schema.si_ad_contextCSN )
{
Entry e = {0};
Attribute a = {0};
- e.e_name = op->o_bd->be_suffix[0];
- e.e_nname = op->o_bd->be_nsuffix[0];
+ e.e_name = si->si_contextdn;
+ e.e_nname = si->si_contextdn;
e.e_attrs = &a;
a.a_desc = slap_schema.si_ad_contextCSN;
return SLAP_CB_CONTINUE;
if ( rs->sr_entry &&
- dn_match( &rs->sr_entry->e_nname, op->o_bd->be_nsuffix )) {
+ dn_match( &rs->sr_entry->e_nname, &si->si_contextdn )) {
if ( SLAP_OPATTRS( rs->sr_attr_flags ) ||
ad_inlist( slap_schema.si_ad_contextCSN, rs->sr_attrs )) {
op->o_dn = be->be_rootdn;
op->o_ndn = be->be_rootndn;
- rc = overlay_entry_get_ov( op, be->be_nsuffix, NULL,
+ if ( SLAP_SYNC_SUBENTRY( be )) {
+ build_new_dn( &si->si_contextdn, be->be_nsuffix,
+ (struct berval *)&slap_ldapsync_cn_bv, NULL );
+ } else {
+ si->si_contextdn = be->be_nsuffix[0];
+ }
+ rc = overlay_entry_get_ov( op, &si->si_contextdn, NULL,
slap_schema.si_ad_contextCSN, 0, &e, on );
if ( e ) {