- LUTIL_SLASHPATH( cargv[1] );
- strcpy( sglob->slapd_replogfile, cargv[1] );
- }
- } else if ( strcasecmp( cargv[0], "replica" ) == 0 ) {
- add_replica( cargv, cargc );
+
+ /* replication log file to which changes are appended */
+ if ( strcasecmp( cargv[0], "replogfile" ) == 0 ) {
+ /*
+ * if slapd_replogfile has a value, the -r option was given,
+ * so use that value. If slapd_replogfile has length == 0,
+ * then we should use the value in the config file we're reading.
+ */
+ if ( cargc < 2 ) {
+ fprintf( stderr,
+ "line %d: missing filename in \"replogfile ",
+ lineno );
+ fprintf( stderr, "<filename>\" line\n" );
+ exit( EXIT_FAILURE );
+
+ } else if ( cargc > 2 && *cargv[2] != '#' ) {
+ fprintf( stderr,
+ "line %d: extra cruft at the end of \"replogfile %s\"",
+ lineno, cargv[1] );
+ fprintf( stderr, "line (ignored)\n" );
+ }
+
+ LUTIL_SLASHPATH( cargv[1] );
+ if ( sglob->slapd_replogfile[0] == '\0' ) {
+ strcpy( sglob->slapd_replogfile, cargv[1] );
+ GOT_REPLOG_SET(got_replog, GOT_REPLOG_YES);
+
+ } else {
+ if ( strcmp( sglob->slapd_replogfile, cargv[1] ) == 0 ) {
+ GOT_REPLOG_SET(got_replog, GOT_REPLOG_YES);
+
+ } else if ( GOT_REPLOG(got_replog) == GOT_REPLOG_YES ) {
+ GOT_REPLOG_SET(got_replog, GOT_REPLOG_DONE);
+
+ } else {
+ GOT_REPLOG_SET(got_replog, GOT_REPLOG_ONE);
+ }
+ }
+
+ } else if ( strcasecmp( cargv[0], "replica" ) == 0 ) {
+ add_replica( cargv, cargc );