]> git.sur5r.net Git - openldap/commitdiff
ITS#7870 ignore index DBs in slapcat
authorHoward Chu <hyc@openldap.org>
Wed, 4 Jun 2014 03:38:21 +0000 (20:38 -0700)
committerHoward Chu <hyc@openldap.org>
Wed, 4 Jun 2014 03:38:21 +0000 (20:38 -0700)
servers/slapd/back-mdb/init.c

index 34ad9cbc094758eead79b289a1c1ef1689c50c6a..d59b207bc652fe64812189b6b80a2d0335f977a7 100644 (file)
@@ -265,10 +265,15 @@ mdb_db_open( BackendDB *be, ConfigReply *cr )
                goto fail;
        }
 
-       rc = mdb_attr_dbs_open( be, txn, cr );
-       if ( rc ) {
-               mdb_txn_abort( txn );
-               goto fail;
+       /* slapcat doesn't need indexes. avoid a failure if
+        * a configured index wasn't created yet.
+        */
+       if ( !(slapMode & SLAP_TOOL_READONLY) ) {
+               rc = mdb_attr_dbs_open( be, txn, cr );
+               if ( rc ) {
+                       mdb_txn_abort( txn );
+                       goto fail;
+               }
        }
 
        rc = mdb_txn_commit(txn);