summaryrefslogtreecommitdiffstats
path: root/src/back-shr.c
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@dahyabhai.net>2012-01-16 17:56:44 -0500
committerNalin Dahyabhai <nalin@dahyabhai.net>2012-01-16 17:56:44 -0500
commit056af9934b22bd997489e4dc2ba28ad954f3d74f (patch)
treeb088d5462a0c2e802aa5ba9982179fa15309e911 /src/back-shr.c
parent925c48d7209e1a06c043428628cf434c52e423d0 (diff)
downloadslapi-nis-056af9934b22bd997489e4dc2ba28ad954f3d74f.tar.gz
slapi-nis-056af9934b22bd997489e4dc2ba28ad954f3d74f.tar.xz
slapi-nis-056af9934b22bd997489e4dc2ba28ad954f3d74f.zip
- if the entry being touched is in an ldbm back-end, but there's no transaction ID, just return, and have faith that we'll be called again in the transaction post
Diffstat (limited to 'src/back-shr.c')
-rw-r--r--src/back-shr.c105
1 files changed, 105 insertions, 0 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) {