From d8da5e4fb7534d2931a01bfc4b6f59bdca206c65 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 15 Sep 2005 23:10:07 +0000 Subject: r10251: some more work on ldb_sqlite3 I must say that writing a new module is a very good way to find lot of subtle bugs laying in the code We need more tests! commit oLschema2ldif.c to keep it safe from data losses (rm -fr :-) update test generic to reflect the fix made on comparsion functions (This used to be commit 4357a2db5eadb15519ed93b957b2bad25ebf2a7d) --- source4/lib/ldb/ldb_tdb/ldb_search.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/lib/ldb/ldb_tdb/ldb_search.c') diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c index 160affd4e7..ca0ae06354 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_search.c +++ b/source4/lib/ldb/ldb_tdb/ldb_search.c @@ -465,6 +465,9 @@ int ltdb_search_bytree(struct ldb_module *module, const struct ldb_dn *base, struct ltdb_private *ltdb = module->private_data; int ret; + if ((base == NULL || base->comp_num == 0) && + (scope == LDB_SCOPE_BASE || scope == LDB_SCOPE_ONELEVEL)) return -1; + /* it is important that we handle dn queries this way, and not via a full db search, otherwise ldb is horribly slow */ if (tree->operation == LDB_OP_EQUALITY && @@ -516,6 +519,9 @@ int ltdb_search(struct ldb_module *module, const struct ldb_dn *base, struct ldb_parse_tree *tree; int ret; + if ((base == NULL || base->comp_num == 0) && + (scope == LDB_SCOPE_BASE || scope == LDB_SCOPE_ONELEVEL)) return -1; + /* check if we are looking for a simple dn */ if (scope == LDB_SCOPE_BASE && (expression == NULL || expression[0] == '\0')) { ret = ltdb_search_dn(module, base, attrs, res); -- cgit