fixed the sense of ldb base dn comparisons in two places, and use a
authorAndrew Tridgell <tridge@samba.org>
Fri, 3 Oct 2008 04:58:46 +0000 (21:58 -0700)
committerAndrew Tridgell <tridge@samba.org>
Fri, 3 Oct 2008 04:58:46 +0000 (21:58 -0700)
direct comparison instead of a sub-tree comparison in another

this fixes basedn searches on the global catalog port

source4/cldap_server/netlogon.c
source4/dsdb/samdb/ldb_modules/partition.c
source4/dsdb/samdb/ldb_modules/proxy.c

index 7dccd81fad2a17d6195dd1a71402b4178fcaf6a4..b31e89b7a5cfcb9f8fd672b32f5e23ca9a529539 100644 (file)
@@ -301,7 +301,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
                server_type |= NBT_SERVER_KDC;
        }
 
-       if (!ldb_dn_compare_base(ldb_get_root_basedn(sam_ctx), ldb_get_default_basedn(sam_ctx))) {
+       if (ldb_dn_compare(ldb_get_root_basedn(sam_ctx), ldb_get_default_basedn(sam_ctx)) == 0) {
                server_type |= NBT_SERVER_DS_DNS_FOREST;
        }
 
index ad2901c308bf4671edaa883bf282110622fcc955..7cc19a10121522d910a44ca7b4b5f945b2521b05 100644 (file)
@@ -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;
                }
        }
index 171832bbb46a9f8abb9a481baac9245e93d2721f..18b0649dda90a35d0fec7331a3302469b61c0c17 100644 (file)
@@ -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;
        }