From 2335e57a898bfe0d0c842b8d5e0b4cbb4589c1a3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 30 Mar 2017 13:10:22 +1300 Subject: [PATCH] ldb_tdb: Avoid reading the index list from the DB if we are already set to override it Signed-off-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher Reviewed-by: Garming Sam --- lib/ldb/ldb_tdb/ldb_cache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ldb/ldb_tdb/ldb_cache.c b/lib/ldb/ldb_tdb/ldb_cache.c index cf25d9afa98..f08e073af1a 100644 --- a/lib/ldb/ldb_tdb/ldb_cache.c +++ b/lib/ldb/ldb_tdb/ldb_cache.c @@ -236,6 +236,16 @@ static int ltdb_index_load(struct ldb_module *module, struct ldb_dn *indexlist_dn; int r; + if (ldb->schema.index_handler_override) { + /* + * we skip loading the @INDEXLIST record when a module is + * supplying its own attribute handling + */ + ltdb->cache->attribute_indexes = true; + ltdb->cache->one_level_indexes = ldb->schema.one_level_indexes; + return 0; + } + talloc_free(ltdb->cache->indexlist); ltdb->cache->indexlist = ldb_msg_new(ltdb->cache); -- 2.47.2