int num_retries = 0;
#ifdef LDAP_SYNC
- Operation *ps_list;
+ Operation *ps_list;
struct psid_entry *pm_list, *pm_prev;
+ int rc;
+ EntryInfo *suffix_ei;
+ Entry *ctxcsn_e;
+ int ctxcsn_added = 0;
#endif
#ifdef NEW_LOGGING
#endif
#ifdef LDAP_SYNC
- pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
- while ( pm_list != NULL ) {
- LDAP_LIST_REMOVE ( pm_list, ps_link );
+ pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
+ while ( pm_list != NULL ) {
+ LDAP_LIST_REMOVE ( pm_list, ps_link );
pm_prev = pm_list;
- pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
+ pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
ch_free( pm_prev );
- }
+ }
#endif
rs->sr_err = TXN_ABORT( ltid );
goto return_results;
}
+#ifdef LDAP_SYNC
+ rc = bdb_csn_commit( op, rs, ltid, ei, &suffix_ei, &ctxcsn_e, &ctxcsn_added, locker );
+ switch ( rc ) {
+ case BDB_CSN_ABORT :
+ goto return_results;
+ case BDB_CSN_RETRY :
+ goto retry;
+ }
+#endif
+
if( op->o_noop ) {
if(( rs->sr_err=TXN_ABORT( ltid )) != 0 ) {
rs->sr_text = "txn_abort (no-op) failed";
if(( rs->sr_err=TXN_PREPARE( ltid, gid )) != 0 ) {
rs->sr_text = "txn_prepare failed";
} else {
+#ifdef LDAP_SYNC
+ struct berval ctx_nrdn;
+#endif
+
bdb_cache_modrdn( save, &op->orr_nnewrdn, e, neip,
bdb->bi_dbenv, locker, &lock );
+
+#ifdef LDAP_SYNC
+ 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 );
+ }
+#endif
+
if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {
rs->sr_text = "txn_commit failed";
} else {
#endif /* defined( LDAP_SLAPI ) */
cleanup:
+
+#ifdef LDAP_SYNC
+ slap_graduate_commit_csn( op );
+#endif
+
op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
Modifications **pmod )
{
Modifications *mod = NULL;
+ Modifications **modtail = &mod;
int a_cnt, d_cnt;
+ int repl_user;
assert( new_rdn != NULL );
assert( !op->orr_deleteoldrdn || old_rdn != NULL );
+ repl_user = be_isupdate( op->o_bd, &op->o_ndn );
+
/* Add new attribute values to the entry */
for ( a_cnt = 0; new_rdn[a_cnt]; a_cnt++ ) {
AttributeDescription *desc = NULL;
}
done:
+
+ if ( !repl_user ) {
+ char textbuf[ SLAP_TEXT_BUFLEN ];
+ size_t textlen = sizeof textbuf;
+
+ for( modtail = &mod;
+ *modtail != NULL;
+ modtail = &(*modtail)->sml_next )
+ {
+ /* empty */
+ }
+
+ rs->sr_err = slap_mods_opattrs( op, mod, modtail, &rs->sr_text, textbuf, textlen );
+ }
+
/* LDAP v2 supporting correct attribute handling. */
if ( rs->sr_err != LDAP_SUCCESS && mod != NULL ) {
Modifications *tmp;