From: Nadezhda Ivanova Date: Thu, 23 May 2024 13:09:26 +0000 (+0300) Subject: ITS#10219 Modify of olcDisabled by removing and adding a value invokes db_open twice X-Git-Tag: OPENLDAP_REL_ENG_2_5_19~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=230bd39c073f1640fe53fc178c432e136cd74f90;p=thirdparty%2Fopenldap.git ITS#10219 Modify of olcDisabled by removing and adding a value invokes db_open twice Do not invoke db_open if the database is not actually disabled --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 7322723997..9c4ab38080 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -1612,14 +1612,16 @@ config_generic(ConfigArgs *c) { case CFG_DISABLED: if ( c->bi ) { - c->bi->bi_flags &= ~SLAP_DBFLAG_DISABLED; - if ( c->bi->bi_db_open ) { - BackendInfo *bi_orig = c->be->bd_info; - c->be->bd_info = c->bi; - rc = c->bi->bi_db_open( c->be, &c->reply ); - c->be->bd_info = bi_orig; + if ( c->bi->bi_flags & SLAP_DBFLAG_DISABLED ) { + c->bi->bi_flags &= ~SLAP_DBFLAG_DISABLED; + if ( c->bi->bi_db_open ) { + BackendInfo *bi_orig = c->be->bd_info; + c->be->bd_info = c->bi; + rc = c->bi->bi_db_open( c->be, &c->reply ); + c->be->bd_info = bi_orig; + } } - } else { + } else if ( c->be->be_flags & SLAP_DBFLAG_DISABLED ){ c->be->be_flags &= ~SLAP_DBFLAG_DISABLED; rc = backend_startup_one( c->be, &c->reply ); }