const char *progname = "slapadd";
struct berval csn;
- struct berval maxcsn = { 0, NULL };
- struct berval ldifcsn = { 0, NULL };
+ struct berval maxcsn = BER_BVNULL;
+ struct berval ldifcsn = BER_BVNULL;
int match;
int provider_subentry = 0;
struct subentryinfo *sei;
Attribute *attr;
Entry *ctxcsn_e;
ID ctxcsn_id;
- struct berval ctxcsn_ndn = { 0, NULL };
+ struct berval ctxcsn_ndn = BER_BVNULL;
int ret;
struct berval bvtext;
int i;
}
}
- if ( update_ctxcsn == SLAP_TOOL_CTXCSN_KEEP ) {
+ if ( update_ctxcsn == SLAP_TOOL_CTXCSN_KEEP &&
+ ( replica_promotion || replica_demotion )) {
if ( is_entry_syncProviderSubentry( e )) {
if ( !LDAP_SLIST_EMPTY( &consumer_subentry )) {
fprintf( stderr, "%s: consumer and provider subentries "
}
}
- if ( !is_entry_syncProviderSubentry( e ) &&
- !is_entry_syncConsumerSubentry( e )) {
+ if (( !is_entry_syncProviderSubentry( e ) &&
+ !is_entry_syncConsumerSubentry( e )) ||
+ ( !replica_promotion && !replica_demotion )) {
if (!dryrun) {
ID id = be->be_entry_put( be, e, &bvtext );
if( id == NOID ) {