diff options
Diffstat (limited to 'src/back-sch.c')
-rw-r--r-- | src/back-sch.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/back-sch.c b/src/back-sch.c index 8a6486f..1a4107e 100644 --- a/src/back-sch.c +++ b/src/back-sch.c @@ -1098,7 +1098,7 @@ backend_startup(struct plugin_state *state) backend_shr_startup(state, SCH_CONTAINER_CONFIGURATION_FILTER); } -void +int backend_init_preop(Slapi_PBlock *pb, struct plugin_state *state) { slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, @@ -1109,18 +1109,21 @@ backend_init_preop(Slapi_PBlock *pb, struct plugin_state *state) backend_bind_cb) != 0) { slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "error hooking up bind callback\n"); + return -1; } /* Intercept compare requests and return the right data. */ if (slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_COMPARE_FN, backend_compare_cb) != 0) { slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "error hooking up compare callback\n"); + return -1; } /* Intercept search requests and return the right data. */ if (slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_SEARCH_FN, backend_search_cb) != 0) { slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "error hooking up search callback\n"); + return -1; } /* Intercept write requests and return an insufficient-access error for * attempts to write to anything we're managing. */ @@ -1128,30 +1131,43 @@ backend_init_preop(Slapi_PBlock *pb, struct plugin_state *state) backend_write_cb) != 0) { slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "error hooking up add callback\n"); + return -1; } if (slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_MODIFY_FN, backend_write_cb) != 0) { slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "error hooking up modify callback\n"); + return -1; } if (slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_MODRDN_FN, backend_write_cb) != 0) { slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "error hooking up modrdn callback\n"); + return -1; } if (slapi_pblock_set(pb, SLAPI_PLUGIN_PRE_DELETE_FN, backend_write_cb) != 0) { slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "error hooking up delete callback\n"); + return -1; } /* We don't hook abandonment requests. */ /* We don't hook unbind requests. */ + return 0; } -void +int backend_init_postop(Slapi_PBlock *pb, struct plugin_state *state) { slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "hooking up postoperation callbacks\n"); - backend_shr_postop_init(pb, state); + return backend_shr_postop_init(pb, state); +} + +int +backend_init_internal_postop(Slapi_PBlock *pb, struct plugin_state *state) +{ + slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, + "hooking up internal postoperation callbacks\n"); + return backend_shr_internal_postop_init(pb, state); } |