int i;
struct berval mc;
struct sync_cookie sc;
-#ifdef NEW_LOGGING
- lutil_log_initialize(argc, argv );
-#endif
slap_tool_init( progname, SLAPADD, argc, argv );
LDAP_SLIST_INIT( &consumer_subentry );
{
fprintf( stderr, "%s: database doesn't support necessary operations.\n",
progname );
- exit( EXIT_FAILURE );
+ if ( dryrun ) {
+ fprintf( stderr, "\t(dry) continuing...\n" );
+
+ } else {
+ exit( EXIT_FAILURE );
+ }
}
lmax = 0;
timestamp.bv_val = timebuf;
timestamp.bv_len = strlen(timebuf);
- if ( be->be_rootndn.bv_len == 0 ) {
- name.bv_val = SLAPD_ANONYMOUS;
- name.bv_len = sizeof(SLAPD_ANONYMOUS) - 1;
- nname.bv_val = SLAPD_ANONYMOUS;
- nname.bv_len = sizeof(SLAPD_ANONYMOUS) - 1;
+ if ( BER_BVISEMPTY( &be->be_rootndn ) ) {
+ BER_BVSTR( &name, SLAPD_ANONYMOUS );
+ nname = name;
} else {
name = be->be_rootdn;
nname = be->be_rootndn;
for ( i = 0; replica_id_list[i] > -1 ; i++ ) {
slap_syncrepl_bv.bv_len = snprintf( slap_syncrepl_bv.bv_val,
- slap_syncrepl_bvc.bv_len,
+ slap_syncrepl_bvc.bv_len+1,
"syncrepl%d", replica_id_list[i] );
slap_syncrepl_cn_bv.bv_len = snprintf( slap_syncrepl_cn_bv.bv_val,
- slap_syncrepl_cn_bvc.bv_len,
+ slap_syncrepl_cn_bvc.bv_len+1,
"cn=syncrepl%d", replica_id_list[i] );
build_new_dn( &ctxcsn_ndn, &be->be_nsuffix[0],
(struct berval *)&slap_syncrepl_cn_bv, NULL );
ch_free( buf );
- if( be->be_entry_close( be )) rc = EXIT_FAILURE;
+ if ( !dryrun ) {
+ if( be->be_entry_close( be ) ) {
+ rc = EXIT_FAILURE;
+ }
- if( be->be_sync ) {
- be->be_sync( be );
+ if( be->be_sync ) {
+ be->be_sync( be );
+ }
}
slap_tool_destroy();
+
return rc;
}
+