From fddeed8adba8004e4bb5678e07461382f6a5124b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 23 Aug 2006 21:04:47 +0000 Subject: r17760: The DNS SRV lookup already sorts by priority and weight so don't use the generic IP list sort in get_sorted_dc_list(). (This used to be commit 03a767539d5b09ebd6564c0c9157de2a6e0e6b89) --- source3/libsmb/namequery.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'source3/libsmb') diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index f6dbe3c548..0bd8bc7cb2 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -1356,6 +1356,9 @@ static BOOL get_dc_list(const char *domain, struct ip_service **ip_list, BOOL done_auto_lookup = False; int auto_count = 0; + *ordered = False; + + /* if we are restricted to solely using DNS for looking up a domain controller, make sure that host lookups are enabled for the 'name resolve order'. If host lookups @@ -1365,14 +1368,17 @@ static BOOL get_dc_list(const char *domain, struct ip_service **ip_list, fstrcpy( resolve_order, lp_name_resolve_order() ); strlower_m( resolve_order ); if ( ads_only ) { - if ( strstr( resolve_order, "host" ) ) + if ( strstr( resolve_order, "host" ) ) { fstrcpy( resolve_order, "ads" ); + + /* DNS SRV lookups used by the ads resolver + are already sorted by priority and weight */ + *ordered = True; + } else fstrcpy( resolve_order, "NULL" ); } - *ordered = False; - /* fetch the server we have affinity for. Add the 'password server' list to a search for our domain controllers */ -- cgit