From ed7572cdfd7efb22c9df75fd56d200b9bafb4150 Mon Sep 17 00:00:00 2001 From: Quanah Gibson-Mount Date: Tue, 29 Sep 2009 21:05:44 +0000 Subject: [PATCH] ITS#6258 --- CHANGES | 1 + doc/man/man8/slapcat.8 | 1 + doc/man/man8/slaptest.8 | 11 +++++++++++ servers/slapd/slapcommon.c | 10 +++++++--- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 4177fdde26..d6cc6af5cd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ OpenLDAP 2.4 Change Log OpenLDAP 2.4.19 Engineering + Fixed slapd tools to allow -n for conversion (ITS#6258) Fixed slapo-dynlist lock leak (ITS#6308) Fixed slapo-pcache cache corruption (ITS#6242) Fixed contrib/nssov getgroupbymembers (ITS#6291) diff --git a/doc/man/man8/slapcat.8 b/doc/man/man8/slapcat.8 index 14cf3b48d4..eda33474a8 100644 --- a/doc/man/man8/slapcat.8 +++ b/doc/man/man8/slapcat.8 @@ -118,6 +118,7 @@ configuration file. The config database .BR slapd\-config (5), is always the first database, so use .B \-n 0 +to select it. The .B \-n diff --git a/doc/man/man8/slaptest.8 b/doc/man/man8/slaptest.8 index cb6f93d9da..21739b71c1 100644 --- a/doc/man/man8/slaptest.8 +++ b/doc/man/man8/slaptest.8 @@ -13,6 +13,8 @@ slaptest \- Check the suitability of the OpenLDAP slapd.conf file [\c .BI \-F \ confdir\fR] [\c +.BI \-n dbnum\fR] +[\c .BI \-o \ option\fR[ = value\fR]] [\c .BR \-Q ] @@ -62,6 +64,15 @@ config file. If a valid config directory exists then the default config file is ignored. If dry-run mode is also specified, no conversion will occur. .TP +.BI \-n \ dbnum +Just open and test the \fIdbnum\fR-th database listed in the +configuration file. +To only test the config database +.BR slapd\-config (5), +use +.B \-n 0 +as it is always the first database. +.TP .BI \-o \ option\fR[ = value\fR] Specify an .I option 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