/* $OpenLDAP$ */
/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
/* slapcommon.c - common routine for the slap tools */
int verbose = 0;
int continuemode = 0;
int nosubordinates = 0;
+int dryrun = 0;
char *ldiffile = NULL;
FILE *ldiffp = NULL;
switch( tool ) {
case SLAPADD:
- options = "b:cd:f:l:n:tv";
+ options = "b:cd:f:l:n:tuv";
break;
case SLAPINDEX:
mode |= SLAP_TRUNCATE_MODE;
break;
+ case 'u': /* dry run */
+ dryrun++;
+ break;
+
case 'v': /* turn on verbose */
verbose++;
break;
exit( EXIT_FAILURE );
}
- rc = schema_init();
+ rc = slap_schema_init();
if (rc != 0 ) {
fprintf( stderr, "%s: slap_schema_init failed!\n", progname );
exit( EXIT_FAILURE );
}
- read_config( conffile );
+ rc = read_config( conffile );
+
+ if ( rc != 0 ) {
+ fprintf( stderr, "%s: bad configuration file!\n", progname );
+ exit( EXIT_FAILURE );
+ }
if ( !nbackends ) {
fprintf( stderr, "No databases found in config file\n" );
exit( EXIT_FAILURE );
}
- rc = schema_prep();
+ rc = slap_schema_check();
if (rc != 0 ) {
fprintf( stderr, "%s: slap_schema_prep failed!\n", progname );
rc = dnNormalize( NULL, &base, &nbase );
if( rc != LDAP_SUCCESS ) {
fprintf( stderr, "%s: slap_init invalid suffix (\"%s\")\n",
- progname, base );
+ progname, base.bv_val );
exit( EXIT_FAILURE );
}
/* If the named base is a glue master, operate on the
* entire context
*/
- if (be->be_glueflags & SLAP_GLUE_INSTANCE)
+ if (be->be_flags & SLAP_BFLAG_GLUE_INSTANCE)
nosubordinates = 1;
} else if ( dbnum == -1 ) {
/* If just doing the first by default and it is a
* glue subordinate, find the master.
*/
- while (be->be_glueflags & SLAP_GLUE_SUBORDINATE) {
+ while (be->be_flags & SLAP_BFLAG_GLUE_SUBORDINATE) {
nosubordinates = 1;
be++;
}