Back to index

openldap  2.4.31
config.c
Go to the documentation of this file.
00001 /* config.c - mdb backend configuration file routine */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 2000-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in the file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 
00017 #include "portable.h"
00018 
00019 #include <stdio.h>
00020 #include <ac/ctype.h>
00021 #include <ac/string.h>
00022 #include <ac/errno.h>
00023 
00024 #include "back-mdb.h"
00025 
00026 #include "config.h"
00027 
00028 #include "lutil.h"
00029 #include "ldap_rq.h"
00030 
00031 static ConfigDriver mdb_cf_gen;
00032 
00033 enum {
00034        MDB_CHKPT = 1,
00035        MDB_DIRECTORY,
00036        MDB_DBNOSYNC,
00037        MDB_INDEX,
00038        MDB_MAXREADERS,
00039        MDB_MAXSIZE,
00040        MDB_MODE,
00041        MDB_SSTACK
00042 };
00043 
00044 static ConfigTable mdbcfg[] = {
00045        { "directory", "dir", 2, 2, 0, ARG_STRING|ARG_MAGIC|MDB_DIRECTORY,
00046               mdb_cf_gen, "( OLcfgDbAt:0.1 NAME 'olcDbDirectory' "
00047                      "DESC 'Directory for database content' "
00048                      "EQUALITY caseIgnoreMatch "
00049                      "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
00050        { "checkpoint", "kbyte> <min", 3, 3, 0, ARG_MAGIC|MDB_CHKPT,
00051               mdb_cf_gen, "( OLcfgDbAt:1.2 NAME 'olcDbCheckpoint' "
00052                      "DESC 'Database checkpoint interval in kbytes and minutes' "
00053                      "SYNTAX OMsDirectoryString SINGLE-VALUE )",NULL, NULL },
00054        { "dbnosync", NULL, 1, 2, 0, ARG_ON_OFF|ARG_MAGIC|MDB_DBNOSYNC,
00055               mdb_cf_gen, "( OLcfgDbAt:1.4 NAME 'olcDbNoSync' "
00056                      "DESC 'Disable synchronous database writes' "
00057                      "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
00058        { "index", "attr> <[pres,eq,approx,sub]", 2, 3, 0, ARG_MAGIC|MDB_INDEX,
00059               mdb_cf_gen, "( OLcfgDbAt:0.2 NAME 'olcDbIndex' "
00060               "DESC 'Attribute index parameters' "
00061               "EQUALITY caseIgnoreMatch "
00062               "SYNTAX OMsDirectoryString )", NULL, NULL },
00063        { "maxreaders", "num", 2, 2, 0, ARG_UINT|ARG_MAGIC|MDB_MAXREADERS,
00064               mdb_cf_gen, "( OLcfgDbAt:12.1 NAME 'olcDbMaxReaders' "
00065               "DESC 'Maximum number of threads that may access the DB concurrently' "
00066               "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
00067        { "maxsize", "size", 2, 2, 0, ARG_ULONG|ARG_MAGIC|MDB_MAXSIZE,
00068               mdb_cf_gen, "( OLcfgDbAt:12.2 NAME 'olcDbMaxSize' "
00069               "DESC 'Maximum size of DB in bytes' "
00070               "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
00071        { "mode", "mode", 2, 2, 0, ARG_MAGIC|MDB_MODE,
00072               mdb_cf_gen, "( OLcfgDbAt:0.3 NAME 'olcDbMode' "
00073               "DESC 'Unix permissions of database files' "
00074               "SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
00075        { "searchstack", "depth", 2, 2, 0, ARG_INT|ARG_MAGIC|MDB_SSTACK,
00076               mdb_cf_gen, "( OLcfgDbAt:1.9 NAME 'olcDbSearchStack' "
00077               "DESC 'Depth of search stack in IDLs' "
00078               "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
00079        { NULL, NULL, 0, 0, 0, ARG_IGNORED,
00080               NULL, NULL, NULL, NULL }
00081 };
00082 
00083 static ConfigOCs mdbocs[] = {
00084        {
00085               "( OLcfgDbOc:12.1 "
00086               "NAME 'olcMdbConfig' "
00087               "DESC 'MDB backend configuration' "
00088               "SUP olcDatabaseConfig "
00089               "MUST olcDbDirectory "
00090               "MAY ( olcDbCheckpoint $ "
00091               "olcDbNoSync $ olcDbIndex $ olcDbMaxReaders $ olcDbMaxsize $ "
00092               "olcDbMode $ olcDbSearchStack ) )",
00093                      Cft_Database, mdbcfg },
00094        { NULL, 0, NULL }
00095 };
00096 
00097 /* perform periodic syncs */
00098 static void *
00099 mdb_checkpoint( void *ctx, void *arg )
00100 {
00101        struct re_s *rtask = arg;
00102        struct mdb_info *mdb = rtask->arg;
00103 
00104        mdb_env_sync( mdb->mi_dbenv, 0 );
00105        ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
00106        ldap_pvt_runqueue_stoptask( &slapd_rq, rtask );
00107        ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
00108        return NULL;
00109 }
00110 
00111 /* reindex entries on the fly */
00112 static void *
00113 mdb_online_index( void *ctx, void *arg )
00114 {
00115        struct re_s *rtask = arg;
00116        BackendDB *be = rtask->arg;
00117        struct mdb_info *mdb = be->be_private;
00118 
00119        Connection conn = {0};
00120        OperationBuffer opbuf;
00121        Operation *op;
00122 
00123        MDB_cursor *curs;
00124        MDB_val key, data;
00125        MDB_txn *txn;
00126        ID id;
00127        Entry *e;
00128        int rc, getnext = 1;
00129        int i;
00130 
00131        connection_fake_init( &conn, &opbuf, ctx );
00132        op = &opbuf.ob_op;
00133 
00134        op->o_bd = be;
00135 
00136        id = 1;
00137        key.mv_size = sizeof(ID);
00138 
00139        while ( 1 ) {
00140               if ( slapd_shutdown )
00141                      break;
00142 
00143               rc = mdb_txn_begin( mdb->mi_dbenv, NULL, 0, &txn );
00144               if ( rc )
00145                      break;
00146               rc = mdb_cursor_open( txn, mdb->mi_id2entry, &curs );
00147               if ( rc ) {
00148                      mdb_txn_abort( txn );
00149                      break;
00150               }
00151               if ( getnext ) {
00152                      getnext = 0;
00153                      key.mv_data = &id;
00154                      rc = mdb_cursor_get( curs, &key, &data, MDB_SET_RANGE );
00155                      if ( rc ) {
00156                             mdb_txn_abort( txn );
00157                             if ( rc == MDB_NOTFOUND )
00158                                    rc = 0;
00159                             break;
00160                      }
00161                      memcpy( &id, key.mv_data, sizeof( id ));
00162               }
00163 
00164               rc = mdb_id2entry( op, curs, id, &e );
00165               mdb_cursor_close( curs );
00166               if ( rc ) {
00167                      mdb_txn_abort( txn );
00168                      if ( rc == MDB_NOTFOUND ) {
00169                             id++;
00170                             getnext = 1;
00171                             continue;
00172                      }
00173                      break;
00174               }
00175               rc = mdb_index_entry( op, txn, MDB_INDEX_UPDATE_OP, e );
00176               if ( rc == 0 ) {
00177                      rc = mdb_txn_commit( txn );
00178                      txn = NULL;
00179               }
00180               if ( rc )
00181                      break;
00182               id++;
00183               getnext = 1;
00184        }
00185 
00186        for ( i = 0; i < mdb->mi_nattrs; i++ ) {
00187               if ( mdb->mi_attrs[ i ]->ai_indexmask & MDB_INDEX_DELETING
00188                      || mdb->mi_attrs[ i ]->ai_newmask == 0 )
00189               {
00190                      continue;
00191               }
00192               mdb->mi_attrs[ i ]->ai_indexmask = mdb->mi_attrs[ i ]->ai_newmask;
00193               mdb->mi_attrs[ i ]->ai_newmask = 0;
00194        }
00195 
00196        ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
00197        ldap_pvt_runqueue_stoptask( &slapd_rq, rtask );
00198        mdb->mi_index_task = NULL;
00199        ldap_pvt_runqueue_remove( &slapd_rq, rtask );
00200        ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
00201 
00202        return NULL;
00203 }
00204 
00205 /* Cleanup loose ends after Modify completes */
00206 static int
00207 mdb_cf_cleanup( ConfigArgs *c )
00208 {
00209        struct mdb_info *mdb = c->be->be_private;
00210        int rc = 0;
00211 
00212        if ( mdb->mi_flags & MDB_DEL_INDEX ) {
00213               mdb_attr_flush( mdb );
00214               mdb->mi_flags ^= MDB_DEL_INDEX;
00215        }
00216 
00217        if ( mdb->mi_flags & MDB_RE_OPEN ) {
00218               mdb->mi_flags ^= MDB_RE_OPEN;
00219               rc = c->be->bd_info->bi_db_close( c->be, &c->reply );
00220               if ( rc == 0 )
00221                      rc = c->be->bd_info->bi_db_open( c->be, &c->reply );
00222               /* If this fails, we need to restart */
00223               if ( rc ) {
00224                      slapd_shutdown = 2;
00225                      snprintf( c->cr_msg, sizeof( c->cr_msg ),
00226                             "failed to reopen database, rc=%d", rc );
00227                      Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(mdb_cf_cleanup)
00228                             ": %s\n", c->cr_msg, 0, 0 );
00229                      rc = LDAP_OTHER;
00230               }
00231        }
00232 
00233        if ( mdb->mi_flags & MDB_OPEN_INDEX ) {
00234               rc = mdb_attr_dbs_open( c->be, NULL, &c->reply );
00235               if ( rc )
00236                      rc = LDAP_OTHER;
00237        }
00238        return rc;
00239 }
00240 
00241 static int
00242 mdb_cf_gen( ConfigArgs *c )
00243 {
00244        struct mdb_info *mdb = c->be->be_private;
00245        int rc;
00246 
00247        if ( c->op == SLAP_CONFIG_EMIT ) {
00248               rc = 0;
00249               switch( c->type ) {
00250               case MDB_MODE: {
00251                      char buf[64];
00252                      struct berval bv;
00253                      bv.bv_len = snprintf( buf, sizeof(buf), "0%o", mdb->mi_dbenv_mode );
00254                      if ( bv.bv_len > 0 && bv.bv_len < sizeof(buf) ) {
00255                             bv.bv_val = buf;
00256                             value_add_one( &c->rvalue_vals, &bv );
00257                      } else {
00258                             rc = 1;
00259                      }
00260                      } break;
00261 
00262               case MDB_CHKPT:
00263                      if ( mdb->mi_txn_cp ) {
00264                             char buf[64];
00265                             struct berval bv;
00266                             bv.bv_len = snprintf( buf, sizeof(buf), "%ld %ld",
00267                                    (long) mdb->mi_txn_cp_kbyte, (long) mdb->mi_txn_cp_min );
00268                             if ( bv.bv_len > 0 && bv.bv_len < sizeof(buf) ) {
00269                                    bv.bv_val = buf;
00270                                    value_add_one( &c->rvalue_vals, &bv );
00271                             } else {
00272                                    rc = 1;
00273                             }
00274                      } else {
00275                             rc = 1;
00276                      }
00277                      break;
00278 
00279               case MDB_DIRECTORY:
00280                      if ( mdb->mi_dbenv_home ) {
00281                             c->value_string = ch_strdup( mdb->mi_dbenv_home );
00282                      } else {
00283                             rc = 1;
00284                      }
00285                      break;
00286 
00287               case MDB_DBNOSYNC:
00288                      if ( mdb->mi_dbenv_flags & MDB_NOSYNC )
00289                             c->value_int = 1;
00290                      break;
00291 
00292               case MDB_INDEX:
00293                      mdb_attr_index_unparse( mdb, &c->rvalue_vals );
00294                      if ( !c->rvalue_vals ) rc = 1;
00295                      break;
00296 
00297               case MDB_SSTACK:
00298                      c->value_int = mdb->mi_search_stack_depth;
00299                      break;
00300 
00301               case MDB_MAXREADERS:
00302                      c->value_int = mdb->mi_readers;
00303                      break;
00304 
00305               case MDB_MAXSIZE:
00306                      c->value_ulong = mdb->mi_mapsize;
00307                      break;
00308               }
00309               return rc;
00310        } else if ( c->op == LDAP_MOD_DELETE ) {
00311               rc = 0;
00312               switch( c->type ) {
00313               case MDB_MODE:
00314 #if 0
00315                      /* FIXME: does it make any sense to change the mode,
00316                       * if we don't exec a chmod()? */
00317                      mdb->bi_dbenv_mode = SLAPD_DEFAULT_DB_MODE;
00318                      break;
00319 #endif
00320 
00321               /* single-valued no-ops */
00322               case MDB_SSTACK:
00323               case MDB_MAXREADERS:
00324               case MDB_MAXSIZE:
00325                      break;
00326 
00327               case MDB_CHKPT:
00328                      if ( mdb->mi_txn_cp_task ) {
00329                             struct re_s *re = mdb->mi_txn_cp_task;
00330                             mdb->mi_txn_cp_task = NULL;
00331                             ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
00332                             if ( ldap_pvt_runqueue_isrunning( &slapd_rq, re ) )
00333                                    ldap_pvt_runqueue_stoptask( &slapd_rq, re );
00334                             ldap_pvt_runqueue_remove( &slapd_rq, re );
00335                             ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
00336                      }
00337                      mdb->mi_txn_cp = 0;
00338                      break;
00339               case MDB_DIRECTORY:
00340                      mdb->mi_flags |= MDB_RE_OPEN;
00341                      ch_free( mdb->mi_dbenv_home );
00342                      mdb->mi_dbenv_home = NULL;
00343                      c->cleanup = mdb_cf_cleanup;
00344                      ldap_pvt_thread_pool_purgekey( mdb->mi_dbenv );
00345                      break;
00346               case MDB_DBNOSYNC:
00347                      mdb_env_set_flags( mdb->mi_dbenv, MDB_NOSYNC, 0 );
00348                      break;
00349               case MDB_INDEX:
00350                      if ( c->valx == -1 ) {
00351                             int i;
00352 
00353                             /* delete all (FIXME) */
00354                             for ( i = 0; i < mdb->mi_nattrs; i++ ) {
00355                                    mdb->mi_attrs[i]->ai_indexmask |= MDB_INDEX_DELETING;
00356                             }
00357                             mdb->mi_flags |= MDB_DEL_INDEX;
00358                             c->cleanup = mdb_cf_cleanup;
00359 
00360                      } else {
00361                             struct berval bv, def = BER_BVC("default");
00362                             char *ptr;
00363 
00364                             for (ptr = c->line; !isspace( (unsigned char) *ptr ); ptr++);
00365 
00366                             bv.bv_val = c->line;
00367                             bv.bv_len = ptr - bv.bv_val;
00368                             if ( bvmatch( &bv, &def )) {
00369                                    mdb->mi_defaultmask = 0;
00370 
00371                             } else {
00372                                    int i;
00373                                    char **attrs;
00374                                    char sep;
00375 
00376                                    sep = bv.bv_val[ bv.bv_len ];
00377                                    bv.bv_val[ bv.bv_len ] = '\0';
00378                                    attrs = ldap_str2charray( bv.bv_val, "," );
00379 
00380                                    for ( i = 0; attrs[ i ]; i++ ) {
00381                                           AttributeDescription *ad = NULL;
00382                                           const char *text;
00383                                           AttrInfo *ai;
00384 
00385                                           slap_str2ad( attrs[ i ], &ad, &text );
00386                                           /* if we got here... */
00387                                           assert( ad != NULL );
00388 
00389                                           ai = mdb_attr_mask( mdb, ad );
00390                                           /* if we got here... */
00391                                           assert( ai != NULL );
00392 
00393                                           ai->ai_indexmask |= MDB_INDEX_DELETING;
00394                                           mdb->mi_flags |= MDB_DEL_INDEX;
00395                                           c->cleanup = mdb_cf_cleanup;
00396                                    }
00397 
00398                                    bv.bv_val[ bv.bv_len ] = sep;
00399                                    ldap_charray_free( attrs );
00400                             }
00401                      }
00402                      break;
00403               }
00404               return rc;
00405        }
00406 
00407        switch( c->type ) {
00408        case MDB_MODE:
00409               if ( ASCII_DIGIT( c->argv[1][0] ) ) {
00410                      long mode;
00411                      char *next;
00412                      errno = 0;
00413                      mode = strtol( c->argv[1], &next, 0 );
00414                      if ( errno != 0 || next == c->argv[1] || next[0] != '\0' ) {
00415                             fprintf( stderr, "%s: "
00416                                    "unable to parse mode=\"%s\".\n",
00417                                    c->log, c->argv[1] );
00418                             return 1;
00419                      }
00420                      mdb->mi_dbenv_mode = mode;
00421 
00422               } else {
00423                      char *m = c->argv[1];
00424                      int who, what, mode = 0;
00425 
00426                      if ( strlen( m ) != STRLENOF("-rwxrwxrwx") ) {
00427                             return 1;
00428                      }
00429 
00430                      if ( m[0] != '-' ) {
00431                             return 1;
00432                      }
00433 
00434                      m++;
00435                      for ( who = 0; who < 3; who++ ) {
00436                             for ( what = 0; what < 3; what++, m++ ) {
00437                                    if ( m[0] == '-' ) {
00438                                           continue;
00439                                    } else if ( m[0] != "rwx"[what] ) {
00440                                           return 1;
00441                                    }
00442                                    mode += ((1 << (2 - what)) << 3*(2 - who));
00443                             }
00444                      }
00445                      mdb->mi_dbenv_mode = mode;
00446               }
00447               break;
00448        case MDB_CHKPT: {
00449               long   l;
00450               mdb->mi_txn_cp = 1;
00451               if ( lutil_atolx( &l, c->argv[1], 0 ) != 0 ) {
00452                      fprintf( stderr, "%s: "
00453                             "invalid kbyte \"%s\" in \"checkpoint\".\n",
00454                             c->log, c->argv[1] );
00455                      return 1;
00456               }
00457               mdb->mi_txn_cp_kbyte = l;
00458               if ( lutil_atolx( &l, c->argv[2], 0 ) != 0 ) {
00459                      fprintf( stderr, "%s: "
00460                             "invalid minutes \"%s\" in \"checkpoint\".\n",
00461                             c->log, c->argv[2] );
00462                      return 1;
00463               }
00464               mdb->mi_txn_cp_min = l;
00465               /* If we're in server mode and time-based checkpointing is enabled,
00466                * submit a task to perform periodic checkpoints.
00467                */
00468               if ((slapMode & SLAP_SERVER_MODE) && mdb->mi_txn_cp_min ) {
00469                      struct re_s *re = mdb->mi_txn_cp_task;
00470                      if ( re ) {
00471                             re->interval.tv_sec = mdb->mi_txn_cp_min * 60;
00472                      } else {
00473                             if ( c->be->be_suffix == NULL || BER_BVISNULL( &c->be->be_suffix[0] ) ) {
00474                                    fprintf( stderr, "%s: "
00475                                           "\"checkpoint\" must occur after \"suffix\".\n",
00476                                           c->log );
00477                                    return 1;
00478                             }
00479                             ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
00480                             mdb->mi_txn_cp_task = ldap_pvt_runqueue_insert( &slapd_rq,
00481                                    mdb->mi_txn_cp_min * 60, mdb_checkpoint, mdb,
00482                                    LDAP_XSTRING(mdb_checkpoint), c->be->be_suffix[0].bv_val );
00483                             ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
00484                      }
00485               }
00486               } break;
00487 
00488        case MDB_DIRECTORY: {
00489               FILE *f;
00490               char *ptr, *testpath;
00491               int len;
00492 
00493               len = strlen( c->value_string );
00494               testpath = ch_malloc( len + STRLENOF(LDAP_DIRSEP) + STRLENOF("DUMMY") + 1 );
00495               ptr = lutil_strcopy( testpath, c->value_string );
00496               *ptr++ = LDAP_DIRSEP[0];
00497               strcpy( ptr, "DUMMY" );
00498               f = fopen( testpath, "w" );
00499               if ( f ) {
00500                      fclose( f );
00501                      unlink( testpath );
00502               }
00503               ch_free( testpath );
00504               if ( !f ) {
00505                      snprintf( c->cr_msg, sizeof( c->cr_msg ), "%s: invalid path: %s",
00506                             c->log, strerror( errno ));
00507                      Debug( LDAP_DEBUG_ANY, "%s\n", c->cr_msg, 0, 0 );
00508                      return -1;
00509               }
00510 
00511               if ( mdb->mi_dbenv_home )
00512                      ch_free( mdb->mi_dbenv_home );
00513               mdb->mi_dbenv_home = c->value_string;
00514 
00515               }
00516               break;
00517 
00518        case MDB_DBNOSYNC:
00519               if ( c->value_int )
00520                      mdb->mi_dbenv_flags |= MDB_NOSYNC;
00521               else
00522                      mdb->mi_dbenv_flags ^= MDB_NOSYNC;
00523               if ( mdb->mi_flags & MDB_IS_OPEN ) {
00524                      mdb_env_set_flags( mdb->mi_dbenv, MDB_NOSYNC,
00525                             c->value_int );
00526               }
00527               break;
00528 
00529        case MDB_INDEX:
00530               rc = mdb_attr_index_config( mdb, c->fname, c->lineno,
00531                      c->argc - 1, &c->argv[1], &c->reply);
00532 
00533               if( rc != LDAP_SUCCESS ) return 1;
00534               c->cleanup = mdb_cf_cleanup;
00535               mdb->mi_flags |= MDB_OPEN_INDEX;
00536               if (( mdb->mi_flags & MDB_IS_OPEN ) && !mdb->mi_index_task ) {
00537                      /* Start the task as soon as we finish here. Set a long
00538                       * interval (10 hours) so that it only gets scheduled once.
00539                       */
00540                      if ( c->be->be_suffix == NULL || BER_BVISNULL( &c->be->be_suffix[0] ) ) {
00541                             fprintf( stderr, "%s: "
00542                                    "\"index\" must occur after \"suffix\".\n",
00543                                    c->log );
00544                             return 1;
00545                      }
00546                      ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
00547                      mdb->mi_index_task = ldap_pvt_runqueue_insert( &slapd_rq, 36000,
00548                             mdb_online_index, c->be,
00549                             LDAP_XSTRING(mdb_online_index), c->be->be_suffix[0].bv_val );
00550                      ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
00551               }
00552               break;
00553 
00554        case MDB_SSTACK:
00555               if ( c->value_int < MINIMUM_SEARCH_STACK_DEPTH ) {
00556                      fprintf( stderr,
00557               "%s: depth %d too small, using %d\n",
00558                      c->log, c->value_int, MINIMUM_SEARCH_STACK_DEPTH );
00559                      c->value_int = MINIMUM_SEARCH_STACK_DEPTH;
00560               }
00561               mdb->mi_search_stack_depth = c->value_int;
00562               break;
00563 
00564        case MDB_MAXREADERS:
00565               mdb->mi_readers = c->value_int;
00566               if ( mdb->mi_flags & MDB_IS_OPEN )
00567                      mdb->mi_flags |= MDB_RE_OPEN;
00568               break;
00569 
00570        case MDB_MAXSIZE:
00571               mdb->mi_mapsize = c->value_ulong;
00572               if ( mdb->mi_flags & MDB_IS_OPEN )
00573                      mdb->mi_flags |= MDB_RE_OPEN;
00574               break;
00575 
00576        }
00577        return 0;
00578 }
00579 
00580 int mdb_back_init_cf( BackendInfo *bi )
00581 {
00582        int rc;
00583        bi->bi_cf_ocs = mdbocs;
00584 
00585        rc = config_register_schema( mdbcfg, mdbocs );
00586        if ( rc ) return rc;
00587        return 0;
00588 }