diff options
author | Simo Sorce <idra@samba.org> | 2005-09-15 23:10:07 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:38:11 -0500 |
commit | d8da5e4fb7534d2931a01bfc4b6f59bdca206c65 (patch) | |
tree | 49c2adff156206f2aaf55ab0bd50fc049d55a8c5 /source4/lib/ldb/ldb_tdb | |
parent | 8bfcb31b0e01d42532db5837b1f0a070eb076bb1 (diff) | |
download | samba-d8da5e4fb7534d2931a01bfc4b6f59bdca206c65.tar.gz samba-d8da5e4fb7534d2931a01bfc4b6f59bdca206c65.tar.bz2 samba-d8da5e4fb7534d2931a01bfc4b6f59bdca206c65.zip |
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)
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_search.c | 6 |
1 files changed, 6 insertions, 0 deletions
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); |