/* config.c - bdb backend configuration file routine */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include <ac/string.h>
#include "back-bdb.h"
+#include "external.h"
#ifdef DB_DIRTY_READ
# define SLAP_BDB_ALLOW_DIRTY_READ
} else if ( strcasecmp( argv[0], "dirtyread" ) == 0 ) {
bdb->bi_db_opflags |= DB_DIRTY_READ;
#endif
- /* transaction checkpoint configuration */
+ /* transaction logging configuration */
} else if ( strcasecmp( argv[0], "dbnosync" ) == 0 ) {
bdb->bi_dbenv_xflags |= DB_TXN_NOSYNC;
if( rc != LDAP_SUCCESS ) return 1;
+ /* unique key for shared memory regions */
+ } else if ( strcasecmp( argv[0], "shm_key" ) == 0 ) {
+ if ( argc < 2 ) {
+ fprintf( stderr,
+ "%s: line %d: missing key in \"shm_key <key>\" line\n",
+ fname, lineno );
+ return( 1 );
+ }
+ bdb->bi_shm_key = atoi( argv[1] );
+
/* size of the cache in entries */
} else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
if ( argc < 2 ) {
/* depth of search stack cache in units of (IDL)s */
} else if ( strcasecmp( argv[0], "searchstack" ) == 0 ) {
- if ( argc < 2 ) {
- fprintf( stderr,
- "%s: line %d: missing depth in \"searchstack <depth>\" line\n",
- fname, lineno );
- return( 1 );
- }
- bdb->bi_search_stack_depth = atoi( argv[1] );
+ if ( argc < 2 ) {
+ fprintf( stderr,
+ "%s: line %d: missing depth in \"searchstack <depth>\" line\n",
+ fname, lineno );
+ return( 1 );
+ }
+ bdb->bi_search_stack_depth = atoi( argv[1] );
+ if ( bdb->bi_search_stack_depth < MINIMUM_SEARCH_STACK_DEPTH ) {
+ fprintf( stderr,
+ "%s: line %d: depth %d too small, using %d\n",
+ fname, lineno, bdb->bi_search_stack_depth,
+ MINIMUM_SEARCH_STACK_DEPTH );
+ bdb->bi_search_stack_depth = MINIMUM_SEARCH_STACK_DEPTH;
+ }
#ifdef SLAP_IDL_CACHE
/* size of the IDL cache in entries */
fname, lineno );
return( 1 );
}
- bdb->bi_idl_cache_max_size = atoi( argv[1] );
+ if ( !( slapMode & SLAP_TOOL_MODE ) )
+ bdb->bi_idl_cache_max_size = atoi( argv[1] );
#endif
/* anything else */