From: Stefan Metzmacher Date: Mon, 27 Oct 2008 08:40:25 +0000 (+0100) Subject: s3: libsmb/namequery: fallback to returning all dcs, when none is available in the... X-Git-Tag: samba-4.0.0alpha6~479^2~3^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c43f96330f2935805ba4f0f8f858a027a90bc4c;p=thirdparty%2Fsamba.git s3: libsmb/namequery: fallback to returning all dcs, when none is available in the requested site It could happen that all dcs in a site are unavailable (some sites have only one dc) and then we need to fallback to get all dcs. metze Signed-off-by: Stefan Metzmacher Signed-off-by: Günther Deschner (cherry picked from commit c127367b1dd622eeceb1f47de0a047c297dda222) --- diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index bcf849b795c..87ed5af14c5 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -2098,6 +2098,15 @@ NTSTATUS get_sorted_dc_list( const char *domain, status = get_dc_list(domain, sitename, ip_list, count, lookup_type, &ordered); + if (NT_STATUS_EQUAL(status, NT_STATUS_NO_LOGON_SERVERS) + && sitename) { + DEBUG(3,("get_sorted_dc_list: no server for name %s available" + " in site %s, fallback to all servers\n", + domain, sitename)); + status = get_dc_list(domain, NULL, ip_list, + count, lookup_type, &ordered); + } + if (!NT_STATUS_IS_OK(status)) { SAFE_FREE(*ip_list); *count = 0;