From c5fdb82d3280a0c94c9b15be0090c08675338159 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 2 Oct 2008 21:58:46 -0700 Subject: fixed the sense of ldb base dn comparisons in two places, and use a direct comparison instead of a sub-tree comparison in another this fixes basedn searches on the global catalog port --- source4/dsdb/samdb/ldb_modules/partition.c | 4 ++-- source4/dsdb/samdb/ldb_modules/proxy.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/dsdb/samdb') diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c index ad2901c308..7cc19a1012 100644 --- a/source4/dsdb/samdb/ldb_modules/partition.c +++ b/source4/dsdb/samdb/ldb_modules/partition.c @@ -493,7 +493,7 @@ static int partition_search(struct ldb_module *module, struct ldb_request *req) } for (i=0; data && data->partitions && data->partitions[i]; i++) { /* Find all partitions under the search base */ - if (ldb_dn_compare_base(req->op.search.base, data->partitions[i]->dn) == 0) { + if (ldb_dn_compare_base(data->partitions[i]->dn, req->op.search.base) == 0) { ret = partition_prep_request(ac, data->partitions[i]); if (ret != LDB_SUCCESS) { return ret; @@ -578,7 +578,7 @@ static int partition_rename(struct ldb_module *module, struct ldb_request *req) } for (i=0; data && data->partitions && data->partitions[i]; i++) { - if (ldb_dn_compare_base(req->op.rename.olddn, data->partitions[i]->dn) == 0) { + if (ldb_dn_compare_base(data->partitions[i]->dn, req->op.rename.olddn) == 0) { matched = i; } } diff --git a/source4/dsdb/samdb/ldb_modules/proxy.c b/source4/dsdb/samdb/ldb_modules/proxy.c index 171832bbb4..18b0649dda 100644 --- a/source4/dsdb/samdb/ldb_modules/proxy.c +++ b/source4/dsdb/samdb/ldb_modules/proxy.c @@ -233,7 +233,7 @@ static void proxy_convert_record(struct ldb_context *ldb, int attr, v; /* fix the message DN */ - if (ldb_dn_compare_base(ldb, proxy->olddn, msg->dn) == 0) { + if (ldb_dn_compare_base(proxy->olddn, msg->dn) == 0) { ldb_dn_remove_base_components(msg->dn, ldb_dn_get_comp_num(proxy->olddn)); ldb_dn_add_base(msg->dn, proxy->newdn); } @@ -322,7 +322,7 @@ static int proxy_search_bytree(struct ldb_module *module, struct ldb_request *re } /* see if the dn is within olddn */ - if (ldb_dn_compare_base(module->ldb, proxy->newdn, req->op.search.base) != 0) { + if (ldb_dn_compare_base(proxy->newdn, req->op.search.base) != 0) { goto passthru; } -- cgit