mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-21 07:09:34 -05:00
ITS#9678 slapadd: avoid destroying configDB prematurely
This commit is contained in:
parent
86baf9a580
commit
09a22d5512
1 changed files with 4 additions and 1 deletions
|
|
@ -5565,6 +5565,8 @@ config_add_oc( ConfigOCs **cop, CfEntryInfo *last, Entry *e, ConfigArgs *ca )
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BackendDB *configDB; /* only set by slapadd */
|
||||||
|
|
||||||
/* Parse an LDAP entry into config directives */
|
/* Parse an LDAP entry into config directives */
|
||||||
static int
|
static int
|
||||||
config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs,
|
config_add_internal( CfBackInfo *cfb, Entry *e, ConfigArgs *ca, SlapReply *rs,
|
||||||
|
|
@ -5911,7 +5913,7 @@ ok:
|
||||||
done:
|
done:
|
||||||
if ( rc ) {
|
if ( rc ) {
|
||||||
if ( (coptr->co_type == Cft_Database) && ca->be ) {
|
if ( (coptr->co_type == Cft_Database) && ca->be ) {
|
||||||
if ( ca->be != frontendDB )
|
if ( ca->be != frontendDB && ca->be != configDB )
|
||||||
backend_destroy_one( ca->be, 1 );
|
backend_destroy_one( ca->be, 1 );
|
||||||
} else if ( (coptr->co_type == Cft_Overlay) && ca->bi ) {
|
} else if ( (coptr->co_type == Cft_Overlay) && ca->bi ) {
|
||||||
overlay_destroy_one( ca->be, (slap_overinst *)ca->bi );
|
overlay_destroy_one( ca->be, (slap_overinst *)ca->bi );
|
||||||
|
|
@ -7885,6 +7887,7 @@ config_tool_entry_open( BackendDB *be, int mode )
|
||||||
CfBackInfo *cfb = be->be_private;
|
CfBackInfo *cfb = be->be_private;
|
||||||
BackendInfo *bi = cfb->cb_db.bd_info;
|
BackendInfo *bi = cfb->cb_db.bd_info;
|
||||||
|
|
||||||
|
configDB = be;
|
||||||
if ( bi && bi->bi_tool_entry_open )
|
if ( bi && bi->bi_tool_entry_open )
|
||||||
return bi->bi_tool_entry_open( &cfb->cb_db, mode );
|
return bi->bi_tool_entry_open( &cfb->cb_db, mode );
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue