]> git.sur5r.net Git - openldap/commitdiff
clarify error message and allow -u (dryrun) option for slaptest, to circumvent databa...
authorPierangelo Masarati <ando@openldap.org>
Sat, 8 Jan 2005 12:02:14 +0000 (12:02 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 8 Jan 2005 12:02:14 +0000 (12:02 +0000)
servers/slapd/back-bdb/init.c
servers/slapd/slapcommon.c

index 6462efdd5e0c6f27c7c77f422045cd533b4de936..e41d699bd668ac6acc800967ea3173efc1e82296 100644 (file)
@@ -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;
                }
 
index 674f06fa3e9dd8f0ddd757c2531674c9ca3228cc..b5134599d18219244f9647bc68073f00447c30c6 100644 (file)
@@ -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;