int
main( int argc, char **argv )
{
- int i, cargc, indb, stop;
- char *cargv[MAXARGS];
- char *defargv[MAXARGS];
+ int i, stop;
char *tailorfile, *inputfile;
char *linep, *buf, *attr;
char line[BUFSIZ];
struct berval bv;
struct berval *vals[2];
+ ldbm_ignore_nextid_file = 1;
+
inputfile = NULL;
tailorfile = SLAPD_DEFAULT_CONFIGFILE;
dbnum = -1;
}
}
- init();
- read_config( tailorfile, &be, NULL );
+ slap_init(SLAP_TOOL_MODE, ch_strdup(argv[0]));
+ read_config( tailorfile );
if ( dbnum == -1 ) {
for ( dbnum = 0; dbnum < nbackends; dbnum++ ) {
fprintf( stderr, "Database number %d selected via -n is not an ldbm database\n", dbnum );
exit( 1 );
}
+
+ slap_startup(dbnum);
+
be = &backends[dbnum];
/* disable write sync'ing */
}
if ( line[0] == '\n' || stop && buf && *buf ) {
if ( *buf != '\n' ) {
- if (isdigit(*buf)) {
+ if (isdigit((unsigned char) *buf)) {
id = atol(buf);
} else {
id++;
lcur = 0;
}
}
- (*be->be_close)( be );
- exit( 0 );
+ slap_shutdown(dbnum);
+ slap_destroy();
+
+ return( 0 );
}