From 0fb6e2a52cb681cfdd73c4be16487d1d9d7d8318 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 Oct 2009 12:29:35 +1100 Subject: s4-ldb: don't try to index non-indexed attributes --- source4/lib/ldb/ldb_tdb/ldb_index.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/lib/ldb/ldb_tdb/ldb_index.c') diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index a04fb1a8bd..a28e97256f 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -1223,9 +1223,13 @@ static int ltdb_index_onelevel(struct ldb_module *module, const struct ldb_messa int ltdb_index_add_element(struct ldb_module *module, struct ldb_dn *dn, struct ldb_message_element *el) { + struct ltdb_private *ltdb = talloc_get_type(ldb_module_get_private(module), struct ltdb_private); if (ldb_dn_is_special(dn)) { return LDB_SUCCESS; } + if (!ltdb_is_indexed(ltdb->cache->indexlist, el->name)) { + return LDB_SUCCESS; + } return ltdb_index_add_el(module, ldb_dn_get_linearized(dn), el); } -- cgit