mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-05 14:42:10 -05:00
Use bi_db_{open,close} to run SLAPI start/close plugins
This commit is contained in:
parent
2d9e341ae9
commit
dab5803a59
2 changed files with 35 additions and 23 deletions
|
|
@ -247,20 +247,7 @@ int slap_startup( Backend *be )
|
|||
slap_name, 0, 0 );
|
||||
|
||||
|
||||
rc = backend_startup( be );
|
||||
|
||||
#ifdef LDAP_SLAPI
|
||||
if( rc == 0 ) {
|
||||
Slapi_PBlock *pb = slapi_pblock_new();
|
||||
|
||||
if ( slapi_int_call_plugins( frontendDB, SLAPI_PLUGIN_START_FN, pb ) < 0 ) {
|
||||
rc = -1;
|
||||
}
|
||||
slapi_pblock_destroy( pb );
|
||||
}
|
||||
#endif /* LDAP_SLAPI */
|
||||
|
||||
return rc;
|
||||
return backend_startup( be );
|
||||
}
|
||||
|
||||
int slap_shutdown( Backend *be )
|
||||
|
|
@ -275,15 +262,7 @@ int slap_shutdown( Backend *be )
|
|||
slap_name, 0, 0 );
|
||||
|
||||
/* let backends do whatever cleanup they need to do */
|
||||
rc = backend_shutdown( be );
|
||||
|
||||
#ifdef LDAP_SLAPI
|
||||
pb = slapi_pblock_new();
|
||||
(void) slapi_int_call_plugins( frontendDB, SLAPI_PLUGIN_CLOSE_FN, pb );
|
||||
slapi_pblock_destroy( pb );
|
||||
#endif /* LDAP_SLAPI */
|
||||
|
||||
return rc;
|
||||
return backend_shutdown( be );
|
||||
}
|
||||
|
||||
int slap_destroy(void)
|
||||
|
|
|
|||
|
|
@ -840,6 +840,36 @@ done:
|
|||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
slapi_over_db_open( BackendDB *be )
|
||||
{
|
||||
Slapi_PBlock *pb;
|
||||
int rc;
|
||||
|
||||
pb = slapi_pblock_new();
|
||||
|
||||
rc = slapi_int_call_plugins( be, SLAPI_PLUGIN_START_FN, pb );
|
||||
|
||||
slapi_pblock_destroy( pb );
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
slapi_over_db_close( BackendDB *be )
|
||||
{
|
||||
Slapi_PBlock *pb;
|
||||
int rc;
|
||||
|
||||
pb = slapi_pblock_new();
|
||||
|
||||
rc = slapi_int_call_plugins( be, SLAPI_PLUGIN_CLOSE_FN, pb );
|
||||
|
||||
slapi_pblock_destroy( pb );
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int
|
||||
slapi_over_init()
|
||||
{
|
||||
|
|
@ -858,6 +888,9 @@ slapi_over_init()
|
|||
slapi.on_bi.bi_op_abandon = slapi_op_func;
|
||||
slapi.on_bi.bi_op_cancel = slapi_op_func;
|
||||
|
||||
slapi.on_bi.bi_db_open = slapi_over_db_open;
|
||||
slapi.on_bi.bi_db_close = slapi_over_db_close;
|
||||
|
||||
slapi.on_bi.bi_extended = slapi_over_extended;
|
||||
slapi.on_bi.bi_access_allowed = slapi_over_access_allowed;
|
||||
slapi.on_bi.bi_operational = slapi_over_aux_operational;
|
||||
|
|
|
|||
Loading…
Reference in a new issue