} else {
struct berval nrdn;
- struct berval ctx_nrdn;
if (pdn.bv_len) {
nrdn.bv_val = op->ora_e->e_nname.bv_val;
if ( !op->o_bd->syncinfo ) {
if ( ctxcsn_added ) {
- ctx_nrdn.bv_val = "cn=ldapsync";
- ctx_nrdn.bv_len = strlen( ctx_nrdn.bv_val );
- bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
+ bdb_cache_add( bdb, suffix_ei, ctxcsn_e, (struct berval *)&slap_ldapsync_cn_bv, locker );
}
}
)
{
struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
- struct berval ctxcsn_rdn = BER_BVNULL;
struct berval ctxcsn_ndn = BER_BVNULL;
struct berval csn = BER_BVNULL;
- struct berval ctx_nrdn = BER_BVC( "cn=ldapsync" );
EntryInfo *ctxcsn_ei = NULL;
EntryInfo *suffix_ei = NULL;
Entry *ctxcsn_e = NULL;
DB_TXN *ltid = NULL;
Attribute *csn_a;
- char substr[67];
char gid[DB_XIDDATASIZE];
char csnbuf[ LDAP_LUTIL_CSNSTR_BUFSIZE ];
int num_retries = 0;
if ( op->o_sync_mode != SLAP_SYNC_NONE ) {
if ( op->o_bd->syncinfo ) {
+ char substr[67];
+ struct berval bv;
sprintf( substr, "cn=syncrepl%d", op->o_bd->syncinfo->id );
- ber_str2bv( substr, strlen( substr ), 0, &ctxcsn_rdn );
- build_new_dn( &ctxcsn_ndn, &op->o_bd->be_nsuffix[0], &ctxcsn_rdn );
+ ber_str2bv( substr, 0, 0, &bv );
+ build_new_dn( &ctxcsn_ndn, &op->o_bd->be_nsuffix[0], &bv );
} else {
- ber_str2bv( "cn=ldapsync", strlen("cn=ldapsync"), 0, &ctxcsn_rdn );
- build_new_dn( &ctxcsn_ndn, &op->o_bd->be_nsuffix[0], &ctxcsn_rdn );
+ build_new_dn( &ctxcsn_ndn, &op->o_bd->be_nsuffix[0], (struct berval *)&slap_ldapsync_cn_bv );
}
ctxcsn_retry :
return rs->sr_err;
}
- bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
+ bdb_cache_add( bdb, suffix_ei, ctxcsn_e, (struct berval *)&slap_ldapsync_cn_bv, locker );
rs->sr_err = TXN_COMMIT( ltid, 0 );
if ( rs->sr_err != 0 ) {
rs->sr_err = LDAP_SUCCESS;
}
} else {
- struct berval ctx_nrdn;
-
bdb_cache_delete( &bdb->bi_cache, e, bdb->bi_dbenv,
locker, &lock );
if ( !op->o_bd->syncinfo ) {
if ( ctxcsn_added ) {
- ctx_nrdn.bv_val = "cn=ldapsync";
- ctx_nrdn.bv_len = strlen( ctx_nrdn.bv_val );
- bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
+ bdb_cache_add( bdb, suffix_ei, ctxcsn_e, (struct berval *)&slap_ldapsync_cn_bv, locker );
}
}
rs->sr_err = LDAP_SUCCESS;
}
} else {
- struct berval ctx_nrdn;
EntryInfo *ctx_ei;
bdb_cache_modify( e, dummy.e_attrs, bdb->bi_dbenv, locker, &lock );
if ( !op->o_bd->syncinfo ) {
if ( ctxcsn_added ) {
- ctx_nrdn.bv_val = "cn=ldapsync";
- ctx_nrdn.bv_len = strlen( ctx_nrdn.bv_val );
- bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
+ bdb_cache_add( bdb, suffix_ei, ctxcsn_e, (struct berval *)&slap_ldapsync_cn_bv, locker );
}
}
if(( rs->sr_err=TXN_PREPARE( ltid, gid )) != 0 ) {
rs->sr_text = "txn_prepare failed";
} else {
- struct berval ctx_nrdn;
-
bdb_cache_modrdn( save, &op->orr_nnewrdn, e, neip,
bdb->bi_dbenv, locker, &lock );
if ( !op->o_bd->syncinfo ) {
if ( ctxcsn_added ) {
- ctx_nrdn.bv_val = "cn=ldapsync";
- ctx_nrdn.bv_len = strlen( ctx_nrdn.bv_val );
- bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
+ bdb_cache_add( bdb, suffix_ei, ctxcsn_e, (struct berval *)&slap_ldapsync_cn_bv, locker );
}
}