/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2009 The OpenLDAP Foundation.
+ * Copyright 1998-2010 The OpenLDAP Foundation.
* Portions Copyright 1998-2003 Kurt D. Zeilenga.
* Portions Copyright 2003 IBM Corporation.
* All rights reserved.
break;
case SLAPTEST:
- options = " [-u]\n";
+ options = " [-n databasenumber] [-u]\n";
break;
case SLAPSCHEMA:
/* tools default to "none", so that at least LDAP_DEBUG_ANY
* messages show up; use -d 0 to reset */
slap_debug = LDAP_DEBUG_NONE;
+ ldif_debug = slap_debug;
#endif
ldap_syslog = 0;
break;
case SLAPTEST:
- options = "d:f:F:o:Quv";
+ options = "d:f:F:n:o:Quv";
mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY;
break;
}
switch ( tool ) {
- case SLAPDN:
case SLAPTEST:
+ if ( dbnum >= 0 )
+ goto get_db;
+ /* FALLTHRU */
+ case SLAPDN:
case SLAPAUTH:
be = NULL;
goto startup;
exit( EXIT_FAILURE );
} else {
+get_db:
LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
if ( dbnum == 0 ) break;
dbnum--;
conffile = NULL;
}
+ if ( confdir != NULL ) {
+ ch_free( confdir );
+ confdir = NULL;
+ }
+
if ( ldiffile != NULL ) {
ch_free( ldiffile );
ldiffile = NULL;