/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2000-2013 The OpenLDAP Foundation.
+ * Copyright 2000-2018 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#endif
"SUP olcDatabaseConfig "
"MUST olcDbDirectory "
- "MAY ( olcDbCacheSize $ olcDbCheckpoint $ olcDbConfig $ "
- "olcDbCryptFile $ olcDbCryptKey $ "
+ "MAY ( olcDbCacheSize $ olcDbCheckpoint $ olcDbChecksum $ "
+ "olcDbConfig $ olcDbCryptFile $ olcDbCryptKey $ "
"olcDbNoSync $ olcDbDirtyRead $ olcDbIDLcacheSize $ "
"olcDbIndex $ olcDbLinearIndex $ olcDbLockDetect $ "
"olcDbMode $ olcDbSearchStack $ olcDbShmKey $ "
{
struct bdb_info *bdb = c->be->be_private;
int rc = 0;
+ BerVarray bva;
if ( bdb->bi_flags & BDB_DEL_INDEX ) {
bdb_attr_flush( bdb );
if ( bdb->bi_flags & BDB_RE_OPEN ) {
bdb->bi_flags ^= BDB_RE_OPEN;
+ bva = bdb->bi_db_config;
+ bdb->bi_db_config = NULL;
rc = c->be->bd_info->bi_db_close( c->be, &c->reply );
if ( rc == 0 ) {
if ( bdb->bi_flags & BDB_UPD_CONFIG ) {
- if ( bdb->bi_db_config ) {
+ if ( bva ) {
int i;
FILE *f = fopen( bdb->bi_db_config_path, "w" );
if ( f ) {
+ bdb->bi_db_config = bva;
+ bva = NULL;
for (i=0; bdb->bi_db_config[i].bv_val; i++)
fprintf( f, "%s\n", bdb->bi_db_config[i].bv_val );
fclose( f );
+ } else {
+ ber_bvarray_free( bva );
}
} else {
unlink( bdb->bi_db_config_path );