From 66570ad5f1fbc2b38c397959f551e5410c3c0186 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 29 Sep 2009 07:33:01 +0000 Subject: [PATCH] ITS#6258 add '-n' option to slaptest --- servers/slapd/slapcommon.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index a5d4b4f5c9..7c948a809d 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -92,7 +92,7 @@ usage( int tool, const char *progname ) break; case SLAPTEST: - options = " [-u]\n"; + options = " [-n databasenumber] [-u]\n"; break; case SLAPSCHEMA: @@ -268,7 +268,7 @@ slap_tool_init( break; case SLAPTEST: - options = "d:f:F:o:Quv"; + options = "d:f:F:n:o:Quv"; mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY; break; @@ -608,8 +608,11 @@ slap_tool_init( } switch ( tool ) { - case SLAPDN: case SLAPTEST: + if ( dbnum >= 0 ) + goto get_db; + /* FALLTHRU */ + case SLAPDN: case SLAPAUTH: be = NULL; goto startup; @@ -733,6 +736,7 @@ slap_tool_init( exit( EXIT_FAILURE ); } else { +get_db: LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) { if ( dbnum == 0 ) break; dbnum--; -- 2.39.5