summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-10-27 09:40:25 +0100
committerStefan Metzmacher <metze@samba.org>2008-12-13 11:42:35 +0100
commit0c43f96330f2935805ba4f0f8f858a027a90bc4c (patch)
tree4a536a723d5ce73c7a6225e38246e032662bad87 /source3/libsmb
parent7f779450cb0b0d9f36665c56c4acd0950daaeab2 (diff)
downloadsamba-0c43f96330f2935805ba4f0f8f858a027a90bc4c.tar.gz
samba-0c43f96330f2935805ba4f0f8f858a027a90bc4c.tar.bz2
samba-0c43f96330f2935805ba4f0f8f858a027a90bc4c.zip
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 <metze@samba.org> Signed-off-by: Günther Deschner <gd@samba.org> (cherry picked from commit c127367b1dd622eeceb1f47de0a047c297dda222)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/namequery.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c
index bcf849b795..87ed5af14c 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;