diff options
Diffstat (limited to 'src/plug-nis.c')
-rw-r--r-- | src/plug-nis.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plug-nis.c b/src/plug-nis.c index c6fa274..24098ae 100644 --- a/src/plug-nis.c +++ b/src/plug-nis.c @@ -60,6 +60,7 @@ #define PLUGIN_ID "nis-server-plugin" #define PLUGIN_POSTOP_ID PLUGIN_ID "-postop" #define PLUGIN_INTERNAL_POSTOP_ID PLUGIN_ID "-internal-postop" +#define PLUGIN_BE_TXN_POSTOP_ID PLUGIN_ID "-be-txn-postop" /* the module initialization function */ static Slapi_PluginDesc @@ -462,6 +463,22 @@ nis_plugin_init_internal_postop(Slapi_PBlock *pb) } return 0; } +#ifdef USE_SLAPI_BE_TXNS +static int +nis_plugin_init_be_txn_postop(Slapi_PBlock *pb) +{ + slapi_pblock_set(pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_03); + slapi_pblock_set(pb, SLAPI_PLUGIN_DESCRIPTION, &plugin_description); + slapi_pblock_set(pb, SLAPI_PLUGIN_PRIVATE, global_plugin_state); + if (backend_init_be_txn_postop(pb, global_plugin_state) == -1) { + slapi_log_error(SLAPI_LOG_PLUGIN, + global_plugin_state->plugin_desc->spd_id, + "error registering be-txn postop hooks\n"); + return -1; + } + return 0; +} +#endif int nis_plugin_init(Slapi_PBlock *pb) { @@ -500,6 +517,17 @@ nis_plugin_init(Slapi_PBlock *pb) "error registering internal postoperation plugin\n"); return -1; } +#ifdef USE_SLAPI_BE_TXNS + if (slapi_register_plugin("betxnpostoperation", TRUE, + "nis_plugin_init_be_txn_postop", + nis_plugin_init_be_txn_postop, + PLUGIN_BE_TXN_POSTOP_ID, NULL, + state->plugin_identity) != 0) { + slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, + "error registering be-txn postoperation plugin\n"); + return -1; + } +#endif slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "registered plugin hooks\n"); global_plugin_state = NULL; |