+/* $OpenLDAP$ */
/*
- * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/* slapcommon.c - common routine for the slap tools */
char *conffile = SLAPD_DEFAULT_CONFIGFILE;
int truncatemode = 0;
int verbose = 0;
-int noschemacheck = 0;
int continuemode = 0;
char *ldiffile = NULL;
char *options = NULL;
fprintf( stderr,
"usage: %s [-v] [-c] [-d debuglevel] [-f configfile]\n"
- "\t[-n databasenumber | -b suffix]", progname );
+ "\t[-n databasenumber | -b suffix]", progname );
switch( tool ) {
case SLAPADD:
- options = "\t[-s] [-l ldiffile]\n";
+ options = "\t[-l ldiffile]\n";
break;
case SLAPCAT:
break;
case SLAPINDEX:
- options = "\tattributetype\n";
+ options = "\n";
break;
}
switch( tool ) {
case SLAPADD:
- options = "b:cd:f:l:n:stv";
+ options = "b:cd:f:l:n:tv";
break;
case SLAPINDEX:
dbnum = atoi( optarg ) - 1;
break;
- case 's': /* disable schema checking */
- noschemacheck++;
- break;
-
case 't': /* turn on truncate */
truncatemode++;
mode |= SLAP_TRUNCATE_MODE;
}
}
- if ( ( argc != optind + (tool == SLAPINDEX ? 1 : 0) )
- || (dbnum >= 0 && base != NULL ) )
- {
+ if ( ( argc != optind ) || (dbnum >= 0 && base != NULL ) ) {
usage( tool );
}
exit( EXIT_FAILURE );
}
+ rc = schema_init();
+
+ if (rc != 0 ) {
+ fprintf( stderr, "%s: slap_schema_init failed!\n", progname );
+ exit( EXIT_FAILURE );
+ }
+
read_config( conffile );
if ( !nbackends ) {
exit( EXIT_FAILURE );
}
+ rc = schema_prep();
+
+ if (rc != 0 ) {
+ fprintf( stderr, "%s: slap_schema_prep failed!\n", progname );
+ exit( EXIT_FAILURE );
+ }
+
if( base != NULL ) {
char *tbase = ch_strdup( base );
- if( dn_normalize_case( tbase ) == NULL ) {
+ if( dn_normalize( tbase ) == NULL ) {
fprintf( stderr, "%s: slap_init invalid suffix (\"%s\")\n",
progname, base );
exit( EXIT_FAILURE );
}
- be = select_backend( tbase );
+ be = select_backend( tbase, 0 );
free( tbase );
if( be == NULL ) {