From d3a7ea635f7f03ea20669aaa788e01c724149e6b Mon Sep 17 00:00:00 2001 From: Nalin Dahyabhai Date: Wed, 6 May 2009 14:17:55 -0400 Subject: - revert to registering plugins at init-time, which is what the docs say we should do - use whether or not the plugin_base is initialized as in indicator of whether the plugin's been started or not --- src/back-shr.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/back-shr.c') diff --git a/src/back-shr.c b/src/back-shr.c index 553de55..8380046 100644 --- a/src/back-shr.c +++ b/src/back-shr.c @@ -1298,6 +1298,10 @@ backend_shr_add_cb(Slapi_PBlock *pb) /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); + if (cbdata.state->plugin_base == NULL) { + /* The plugin was not actually started. */ + return 0; + } slapi_pblock_get(pb, SLAPI_ADD_TARGET, &cbdata.ndn); slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &cbdata.e); cbdata.pb = pb; @@ -1401,6 +1405,10 @@ backend_shr_modify_cb(Slapi_PBlock *pb) /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); + if (cbdata.state->plugin_base == NULL) { + /* The plugin was not actually started. */ + return 0; + } slapi_pblock_get(pb, SLAPI_MODIFY_TARGET, &cbdata.ndn); slapi_pblock_get(pb, SLAPI_MODIFY_MODS, &cbdata.mods); slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &cbdata.e_pre); @@ -1529,6 +1537,10 @@ backend_shr_modrdn_cb(Slapi_PBlock *pb) /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); + if (cbdata.state->plugin_base == NULL) { + /* The plugin was not actually started. */ + return 0; + } slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &cbdata.e_pre); slapi_pblock_get(pb, SLAPI_ENTRY_POST_OP, &cbdata.e_post); @@ -1628,6 +1640,10 @@ backend_shr_delete_cb(Slapi_PBlock *pb) /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); + if (cbdata.state->plugin_base == NULL) { + /* The plugin was not actually started. */ + return 0; + } slapi_pblock_get(pb, SLAPI_DELETE_TARGET, &cbdata.ndn); slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &cbdata.e); cbdata.pb = pb; -- cgit