From: Howard Chu Date: Fri, 25 Nov 2005 21:51:49 +0000 (+0000) Subject: ITS#4198 initialize logdb contextCSN from main DB contextCSN X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~688 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=abc13afcc9991c33ff2d4f7627d838fe847a0670;p=openldap ITS#4198 initialize logdb contextCSN from main DB contextCSN --- diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index 87a2aa7892..e802492e8f 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -1243,6 +1243,8 @@ accesslog_db_open( char *ptr; AttributeDescription *ad = NULL; const char *text = NULL; + Entry *e_ctx; + e = ch_calloc( 1, sizeof( Entry )); e->e_name = *li->li_db->be_suffix; e->e_nname = *li->li_db->be_nsuffix; @@ -1268,6 +1270,23 @@ accesslog_db_open( nrdn.bv_val = ptr+1; attr_merge_one( e, ad, &rdn, &nrdn ); + /* Get contextCSN from main DB */ + op->o_bd = be; + op->o_bd->bd_info = on->on_info->oi_orig; + rc = be_entry_get_rw( op, be->be_nsuffix, NULL, + slap_schema.si_ad_contextCSN, 0, &e_ctx ); + + if ( e_ctx ) { + Attribute *a; + + a = attr_find( e_ctx->e_attrs, slap_schema.si_ad_contextCSN ); + if ( a ) + attr_merge( e, a->a_desc, a->a_vals, NULL ); + be_entry_release_rw( op, e_ctx, 0 ); + } + op->o_bd->bd_info = (BackendInfo *)on; + op->o_bd = li->li_db; + op->ora_e = e; op->o_req_dn = e->e_name; op->o_req_ndn = e->e_nname;