Full_Name: Rein Tollevik Version: 2.4.8 OS: URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (84.215.2.34)
syncprov_checkpoint() writes the contextCSN attribute to the suffix of the backend DB that is currently being written when it is triggered. When syncprov is stacked on top of a set of glue'ed databases this can be any of the subordinate backend DBs. The attached patch fixes this problem.
Rein Tollevik Basefarm AS
Index: OpenLDAP/servers/slapd/overlays/syncprov.c diff -u OpenLDAP/servers/slapd/overlays/syncprov.c:1.1.1.11 OpenLDAP/servers/slapd/overlays/syncprov.c:1.5 --- OpenLDAP/servers/slapd/overlays/syncprov.c:1.1.1.11 Thu Feb 21 14:55:36 2008 +++ OpenLDAP/servers/slapd/overlays/syncprov.c Fri Mar 14 16:23:48 2008 @@ -1301,6 +1301,7 @@ Operation opm; SlapReply rsm = { 0 }; slap_callback cb = {0}; + BackendInfo *bi = on->on_info->oi_origdb->bd_info;
mod.sml_numvals = si->si_numcsns; mod.sml_values = si->si_ctxcsn; @@ -1316,8 +1317,9 @@ opm.o_callback = &cb; opm.orm_modlist = &mod; opm.orm_no_opattrs = 1; - opm.o_req_dn = op->o_bd->be_suffix[0]; - opm.o_req_ndn = op->o_bd->be_nsuffix[0]; + opm.o_bd = on->on_info->oi_origdb; + opm.o_req_dn = opm.o_bd->be_suffix[0]; + opm.o_req_ndn = opm.o_bd->be_nsuffix[0]; opm.o_bd->bd_info = on->on_info->oi_orig; opm.o_managedsait = SLAP_CONTROL_NONCRITICAL; opm.o_no_schema_check = 1; @@ -1326,6 +1328,7 @@ slap_mods_free( mod.sml_next, 1 ); } opm.orm_no_opattrs = 0; + opm.o_bd->bd_info = bi; }
static void