r18433: Make sure to search below the partitions baseDN for the netbios name.
authorAndrew Bartlett <abartlet@samba.org>
Tue, 12 Sep 2006 22:03:24 +0000 (22:03 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:18:28 +0000 (14:18 -0500)
I think we should have a helper function for this search, we do it too
often...

Andrew Bartlett
(This used to be commit 09327baa0ded3a98398b266c960f827b29021d91)

source4/nbt_server/dgram/netlogon.c

index e4cc4c966b2d7bbcef02d18ad99a151ea373613d..9f4803c704f19962df74cd3275b643fbae898ef0 100644 (file)
@@ -45,6 +45,7 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot,
        const char *ref_attrs[] = {"nETBIOSName", NULL};
        struct ldb_message **ref_res;
        struct ldb_context *samctx;
+       const struct ldb_dn *partitions_basedn;
        int ret;
 
        /* only answer getdc requests on the PDC or LOGON names */
@@ -58,7 +59,9 @@ static void nbtd_netlogon_getdc(struct dgram_mailslot_handler *dgmslot,
                return;
        }
 
-       ret = gendb_search(samctx, samctx, NULL, &ref_res, ref_attrs,
+       partitions_basedn = samdb_partitions_dn(sam_ctx, mem_ctx);
+
+       ret = gendb_search(samctx, samctx, partitions_basedn, &ref_res, ref_attrs,
                           "(&(&(nETBIOSName=%s)(objectclass=crossRef))(ncName=*))", 
                           name->name);