mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
ITS#4198 initialize logdb contextCSN from main DB contextCSN
This commit is contained in:
parent
72fee93e31
commit
abc13afcc9
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user