From: Andrew Bartlett Date: Thu, 30 Mar 2017 00:10:22 +0000 (+1300) Subject: ldb_tdb: Avoid reading the index list from the DB if we are already set to override it X-Git-Tag: ldb-1.1.30~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2335e57a898bfe0d0c842b8d5e0b4cbb4589c1a3;p=thirdparty%2Fsamba.git 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 --- 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);