net: fix the order of DC lookup methods when joining a domain
authorUri Simchoni <urisimchoni@gmail.com>
Sun, 28 Jun 2015 11:36:22 +0000 (14:36 +0300)
committerJeremy Allison <jra@samba.org>
Thu, 9 Jul 2015 10:33:25 +0000 (12:33 +0200)
commited2ed1ad694ad1cc9e618baf1398ee26a4cdbde8
tree369428d867dda6874f33cc31043ebb1b60c739d4
parentf9cc2de6129a7f998132cdc56c4c742d25b47f27
net: fix the order of DC lookup methods when joining a domain

The dsgetdcname() function is able to try just DNS lookup, just NetBIOS,
or start with DNS and fall back to NetBIOS. For "net ads join", we know
most of the time whether the name of the domain we're joining is a DNS
name or a NetBIOS name. In that case, it makes no sense to try both lookup
methods, especially that DNS may fail and we want to fall back from site-aware
DNS lookup to site-less DNS lookup, with no NetBIOS lookup in between.

This change lets "net ads join" tell libnet what is the type of the domain
name, if it is known.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libnet/libnet_join.c
source3/librpc/idl/libnet_join.idl
source3/utils/net_ads.c