summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_cm.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-09-11 13:28:35 +0200
committerGünther Deschner <gd@samba.org>2012-09-28 22:44:08 +0200
commit8e53b9dd51b25c9830799e162f7b98286d844c96 (patch)
treeab1aebca22dd0b9d71b0fdc890e9935f60ee335c /source3/winbindd/winbindd_cm.c
parent0d7a2af9084c376ad4f664389bb8a59dd6887ab7 (diff)
downloadsamba-8e53b9dd51b25c9830799e162f7b98286d844c96.tar.gz
samba-8e53b9dd51b25c9830799e162f7b98286d844c96.tar.bz2
samba-8e53b9dd51b25c9830799e162f7b98286d844c96.zip
s3-winbindd: Allow DNS resolution of trusted domains if DNS name is avaliable
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/winbindd/winbindd_cm.c')
-rw-r--r--source3/winbindd/winbindd_cm.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index c08530e819..0639be1fb5 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1286,10 +1286,17 @@ static bool get_dcs(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
iplist_size = 0;
}
- /* Try standard netbios queries if no ADS */
+ /* Try standard netbios queries if no ADS and fall back to DNS queries
+ * if alt_name is available */
if (*num_dcs == 0) {
get_sorted_dc_list(domain->name, NULL, &ip_list, &iplist_size,
- False);
+ false);
+ if (iplist_size == 0) {
+ if (domain->alt_name != NULL) {
+ get_sorted_dc_list(domain->alt_name, NULL, &ip_list,
+ &iplist_size, true);
+ }
+ }
for ( i=0; i<iplist_size; i++ ) {
char addr[INET6_ADDRSTRLEN];