From: Pierangelo Masarati Date: Sat, 8 Jan 2005 12:02:14 +0000 (+0000) Subject: clarify error message and allow -u (dryrun) option for slaptest, to circumvent databa... X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~447 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0ea4070eb15bfbce6d2e6c5e3425a031aa899ad2;p=openldap clarify error message and allow -u (dryrun) option for slaptest, to circumvent database startup --- diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 6462efdd5e..e41d699bd6 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -378,10 +378,14 @@ bdb_db_open( BackendDB *be ) bdb->bi_dbenv_mode ); #endif - if( rc != 0 ) { + if ( rc != 0 ) { + char buf[SLAP_TEXT_BUFLEN]; + + snprintf( buf, sizeof(buf), "%s/%s", + bdb->bi_dbenv_home, bdbi_databases[i].file ); Debug( LDAP_DEBUG_ANY, "bdb_db_open: db_open(%s) failed: %s (%d)\n", - bdb->bi_dbenv_home, db_strerror(rc), rc ); + buf, db_strerror(rc), rc ); return rc; } diff --git a/servers/slapd/slapcommon.c b/servers/slapd/slapcommon.c index 674f06fa3e..b5134599d1 100644 --- a/servers/slapd/slapcommon.c +++ b/servers/slapd/slapcommon.c @@ -49,35 +49,39 @@ usage( int tool, const char *progname ) { char *options = NULL; fprintf( stderr, - "usage: %s [-v] [-c] [-d debuglevel] [-f configfile]\n", + "usage: %s [-v] [-c] [-d debuglevel] [-f configfile]", progname ); switch( tool ) { + case SLAPACL: + options = "\n\t[-U authcID | -D authcDN]" + " -b DN [attr[/access][:value]] [...]\n"; + break; + case SLAPADD: - options = "\t[-n databasenumber | -b suffix]\n" + options = "\n\t[-n databasenumber | -b suffix]\n" "\t[-l ldiffile] [-u] [-p [-w] | -r [-i syncreplidlist] [-w]]\n"; break; + case SLAPAUTH: + options = "\n\t[-U authcID] [-X authzID] [-R realm] [-M mech] ID [...]\n"; + break; + case SLAPCAT: - options = "\t[-n databasenumber | -b suffix]" + options = "\n\t[-n databasenumber | -b suffix]" " [-l ldiffile] [-a filter] [-m] [-k]\n"; break; case SLAPDN: - options = "\tDN [...]\n"; + options = " DN [...]\n"; break; case SLAPINDEX: - options = "\t[-n databasenumber | -b suffix]\n"; - break; - - case SLAPAUTH: - options = "\t[-U authcID] [-X authzID] [-R realm] [-M mech] ID [...]\n"; + options = "\n\t[-n databasenumber | -b suffix]\n"; break; - case SLAPACL: - options = "\t[-U authcID | -D authcDN]" - " -b DN [attr[/access][:value]] [...]\n"; + case SLAPTEST: + options = " [-u]\n"; break; } @@ -132,11 +136,15 @@ slap_tool_init( break; case SLAPDN: - case SLAPTEST: options = "d:f:v"; mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY; break; + case SLAPTEST: + options = "d:f:uv"; + mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY; + break; + case SLAPAUTH: options = "d:f:M:R:U:vX:"; mode |= SLAP_TOOL_READMAIN | SLAP_TOOL_READONLY;