From: Gary Lockyer Date: Mon, 26 Feb 2018 21:01:38 +0000 (+1300) Subject: ldb_tdb: Combine identical not GUID index and special DN cases X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=9a4fd23407da70a7b279a24fca8a6f037e66a477;p=metze%2Fsamba%2Fwip.git ldb_tdb: Combine identical not GUID index and special DN cases Fold together two identical cases to simplify the code. Signed-off-by: Gary Lockyer Reviewed-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/ldb_tdb/ldb_search.c b/lib/ldb/ldb_tdb/ldb_search.c index 0af230f219bc..d8bf865e7859 100644 --- a/lib/ldb/ldb_tdb/ldb_search.c +++ b/lib/ldb/ldb_tdb/ldb_search.c @@ -292,19 +292,9 @@ int ltdb_search_dn1(struct ldb_module *module, struct ldb_dn *dn, struct ldb_mes }; TALLOC_CTX *tdb_key_ctx = NULL; - if (ltdb->cache->GUID_index_attribute == NULL) { - tdb_key_ctx = talloc_new(msg); - if (!tdb_key_ctx) { - return ldb_module_oom(module); - } + if (ltdb->cache->GUID_index_attribute == NULL || + ldb_dn_is_special(dn)) { - /* form the key */ - tdb_key = ltdb_key_dn(module, tdb_key_ctx, dn); - if (!tdb_key.dptr) { - TALLOC_FREE(tdb_key_ctx); - return LDB_ERR_OPERATIONS_ERROR; - } - } else if (ldb_dn_is_special(dn)) { tdb_key_ctx = talloc_new(msg); if (!tdb_key_ctx) { return ldb_module_oom(module);