From: Howard Chu Date: Tue, 29 Sep 2009 07:33:01 +0000 (+0000) Subject: ITS#6258 add '-n' option to slaptest X-Git-Tag: ACLCHECK_0~208 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=66570ad5f1fbc2b38c397959f551e5410c3c0186;p=openldap ITS#6258 add '-n' option to slaptest --- 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--;