From a3b33d6fa811dd1277e51e17ba4a4c3954457397 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 11 Oct 2005 04:34:15 +0000 Subject: r10889: make searches for dn's less of a special case, and much faster when part of more complex expressions (This used to be commit 40d304140b4cf22559d6b55c8cbaf1b984baf62f) --- source4/lib/ldb/ldb_tdb/ldb_index.c | 7 +++++++ 1 file changed, 7 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 c2a4fb1ea8..7c920dd78b 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -319,6 +319,13 @@ static int ltdb_index_dn_leaf(struct ldb_module *module, if (ldb_attr_cmp(tree->u.equality.attr, LTDB_OBJECTCLASS) == 0) { return ltdb_index_dn_objectclass(module, tree, index_list, list); } + if (ldb_attr_cmp(tree->u.equality.attr, "distinguishedName") == 0 || + ldb_attr_cmp(tree->u.equality.attr, "dn") == 0) { + char *dn = talloc_strdup(list, (char *)tree->u.equality.value.data); + list->count = 1; + list->dn = &dn; + return 1; + } return ltdb_index_dn_simple(module, tree, index_list, list); } -- cgit