]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-mdb/config.c
ITS#7912 fix index config
[openldap] / servers / slapd / back-mdb / config.c
index 84224df29dfe99bf230efcaaa2b8de7137981a4b..5b402c55a10e98225268c97c4b70c91197f975d9 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2013 The OpenLDAP Foundation.
+ * Copyright 2000-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -59,6 +59,7 @@ static ConfigTable mdbcfg[] = {
        { "envflags", "flags", 2, 0, 0, ARG_MAGIC|MDB_ENVFLAGS,
                mdb_cf_gen, "( OLcfgDbAt:12.3 NAME 'olcDbEnvFlags' "
                        "DESC 'Database environment flags' "
+                       "EQUALITY caseIgnoreMatch "
                        "SYNTAX OMsDirectoryString )", NULL, NULL },
        { "index", "attr> <[pres,eq,approx,sub]", 2, 3, 0, ARG_MAGIC|MDB_INDEX,
                mdb_cf_gen, "( OLcfgDbAt:0.2 NAME 'olcDbIndex' "
@@ -618,23 +619,25 @@ mdb_cf_gen( ConfigArgs *c )
                        c->argc - 1, &c->argv[1], &c->reply);
 
                if( rc != LDAP_SUCCESS ) return 1;
-               c->cleanup = mdb_cf_cleanup;
                mdb->mi_flags |= MDB_OPEN_INDEX;
-               if (( mdb->mi_flags & MDB_IS_OPEN ) && !mdb->mi_index_task ) {
-                       /* Start the task as soon as we finish here. Set a long
-                        * interval (10 hours) so that it only gets scheduled once.
-                        */
-                       if ( c->be->be_suffix == NULL || BER_BVISNULL( &c->be->be_suffix[0] ) ) {
-                               fprintf( stderr, "%s: "
-                                       "\"index\" must occur after \"suffix\".\n",
-                                       c->log );
-                               return 1;
+               if ( mdb->mi_flags & MDB_IS_OPEN ) {
+                       c->cleanup = mdb_cf_cleanup;
+                       if ( !mdb->mi_index_task ) {
+                               /* Start the task as soon as we finish here. Set a long
+                                * interval (10 hours) so that it only gets scheduled once.
+                                */
+                               if ( c->be->be_suffix == NULL || BER_BVISNULL( &c->be->be_suffix[0] ) ) {
+                                       fprintf( stderr, "%s: "
+                                               "\"index\" must occur after \"suffix\".\n",
+                                               c->log );
+                                       return 1;
+                               }
+                               ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
+                               mdb->mi_index_task = ldap_pvt_runqueue_insert( &slapd_rq, 36000,
+                                       mdb_online_index, c->be,
+                                       LDAP_XSTRING(mdb_online_index), c->be->be_suffix[0].bv_val );
+                               ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
                        }
-                       ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
-                       mdb->mi_index_task = ldap_pvt_runqueue_insert( &slapd_rq, 36000,
-                               mdb_online_index, c->be,
-                               LDAP_XSTRING(mdb_online_index), c->be->be_suffix[0].bv_val );
-                       ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
                }
                break;