diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/back-shr.c | 105 | ||||
-rw-r--r-- | src/plug-nis.c | 2 | ||||
-rw-r--r-- | src/plug-sch.c | 2 |
3 files changed, 105 insertions, 4 deletions
diff --git a/src/back-shr.c b/src/back-shr.c index 31edfe9..111676f 100644 --- a/src/back-shr.c +++ b/src/back-shr.c @@ -888,6 +888,27 @@ backend_shr_update_references_cb(const char *group, const char *set, cbdata = cbdata_ptr; state = set_data->state; +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (cbdata->pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(cbdata->pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(cbdata->pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* If the entry didn't change any attributes which are at all relevant * to this map, then we don't need to recompute anything. */ if (set_data->skip_uninteresting_updates && @@ -1501,6 +1522,27 @@ backend_shr_add_cb(Slapi_PBlock *pb) return 0; } +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -1654,6 +1696,27 @@ backend_shr_modify_cb(Slapi_PBlock *pb) return 0; } +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -1798,6 +1861,27 @@ backend_shr_modrdn_cb(Slapi_PBlock *pb) return 0; } +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { @@ -1909,6 +1993,27 @@ backend_shr_delete_cb(Slapi_PBlock *pb) return 0; } +#ifdef USE_SLAPI_BE_TXNS + /* If the backend type is "ldbm database" and we have no transaction, + * do nothing, because we'll be called again later post-transaction, + * and we'll deal with it then. */ + if (pb != NULL) { + void *txn; + char *be_type; + txn = NULL; + be_type = NULL; +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_TXN, &txn); +#endif +#ifdef SLAPI_TXN + slapi_pblock_get(pb, SLAPI_BE_TYPE, &be_type); +#endif + if ((txn == NULL) && (strcmp(be_type, "ldbm database") == 0)) { + return 0; + } + } +#endif + /* Read parameters from the pblock. */ slapi_pblock_get(pb, SLAPI_PLUGIN_PRIVATE, &cbdata.state); if (cbdata.state->plugin_base == NULL) { diff --git a/src/plug-nis.c b/src/plug-nis.c index d91cebf..cb6cad7 100644 --- a/src/plug-nis.c +++ b/src/plug-nis.c @@ -534,7 +534,6 @@ nis_plugin_init(Slapi_PBlock *pb) return -1; } #ifdef USE_SLAPI_BE_TXNS -#if 0 if (slapi_register_plugin("betxnpostoperation", TRUE, "nis_plugin_init_be_txn_postop", nis_plugin_init_be_txn_postop, @@ -545,7 +544,6 @@ nis_plugin_init(Slapi_PBlock *pb) return -1; } #endif -#endif slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "registered plugin hooks\n"); global_plugin_state = NULL; diff --git a/src/plug-sch.c b/src/plug-sch.c index 9c6971c..c30af19 100644 --- a/src/plug-sch.c +++ b/src/plug-sch.c @@ -230,7 +230,6 @@ schema_compat_plugin_init(Slapi_PBlock *pb) return -1; } #ifdef USE_SLAPI_BE_TXNS -#if 0 if (slapi_register_plugin("betxnpostoperation", TRUE, "schema_compat_plugin_init_be_txn_postop", schema_compat_plugin_init_be_txn_postop, @@ -241,7 +240,6 @@ schema_compat_plugin_init(Slapi_PBlock *pb) return -1; } #endif -#endif slapi_log_error(SLAPI_LOG_PLUGIN, state->plugin_desc->spd_id, "registered plugin hooks\n"); global_plugin_state = NULL; |