diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-11-27 12:59:51 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-11-27 03:47:52 +0100 |
commit | dbb9500448ada04094db854aa81118d95cdc687a (patch) | |
tree | 25a76d392e60b20848b93b8f9d559a8c3c926d47 | |
parent | 8737baee7c8666b268bff88070ac93164d41470f (diff) | |
download | samba-dbb9500448ada04094db854aa81118d95cdc687a.tar.gz samba-dbb9500448ada04094db854aa81118d95cdc687a.tar.bz2 samba-dbb9500448ada04094db854aa81118d95cdc687a.zip |
s4-libnet: use the full DNS domain for CLDAP lookups if possible
many of the internal libnet interfaces use the short domain name,
which leads to unreliable NBT lookups. If we are trying to look for
our workgroup, then look for our DNS domain instead
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Sat Nov 27 03:47:52 CET 2010 on sn-devel-104
-rw-r--r-- | source4/libnet/libnet_lookup.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c index 66750706d8..272a3fad41 100644 --- a/source4/libnet/libnet_lookup.c +++ b/source4/libnet/libnet_lookup.c @@ -195,7 +195,12 @@ struct tevent_req *libnet_LookupDCs_send(struct libnet_context *ctx, struct finddcs finddcs_io; ZERO_STRUCT(finddcs_io); - finddcs_io.in.domain_name = io->in.domain_name; + + if (strcasecmp_m(io->in.domain_name, lpcfg_workgroup(ctx->lp_ctx)) == 0) { + finddcs_io.in.domain_name = lpcfg_dnsdomain(ctx->lp_ctx); + } else { + finddcs_io.in.domain_name = io->in.domain_name; + } finddcs_io.in.minimum_dc_flags = NBT_SERVER_LDAP | NBT_SERVER_DS | NBT_SERVER_WRITABLE; finddcs_io.in.server_address = ctx->server_address; |