summaryrefslogtreecommitdiff
path: root/lib/ldb/ldb_tdb/ldb_tdb.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ldb/ldb_tdb/ldb_tdb.c')
-rw-r--r--lib/ldb/ldb_tdb/ldb_tdb.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c
index 4fb151622a..30c58f5ee3 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -229,7 +229,13 @@ static int ltdb_modified(struct ldb_module *module, struct ldb_dn *dn)
if (ldb_dn_is_special(dn) &&
(ldb_dn_check_special(dn, LTDB_INDEXLIST) ||
- ldb_dn_check_special(dn, LTDB_ATTRIBUTES)) ) {
+ ldb_dn_check_special(dn, LTDB_ATTRIBUTES)) )
+ {
+ if (ltdb->warn_reindex) {
+ ldb_debug(ldb_module_get_ctx(module),
+ LDB_DEBUG_ERROR, "Reindexing %s due to modification on %s",
+ tdb_name(ltdb->tdb), ldb_dn_get_linearized(dn));
+ }
ret = ltdb_reindex(module);
}
@@ -1565,6 +1571,10 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
ltdb->warn_unindexed = true;
}
+ if (getenv("LDB_WARN_REINDEX")) {
+ ltdb->warn_reindex = true;
+ }
+
ltdb->sequence_number = 0;
module = ldb_module_new(ldb, ldb, "ldb_tdb backend", &ltdb_ops);