summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-10-27 09:40:25 +0100
committerKarolin Seeger <kseeger@samba.org>2008-12-15 08:36:53 +0100
commitca86e6ae361434e9ecc8bff76cf670806886beac (patch)
tree93d4e38dfb9088c11ab436cccb80d39bb0cdfbf9 /source
parente0983f0d93b0a6f5c2588609ebfa2e981dce0cfc (diff)
downloadsamba-ca86e6ae361434e9ecc8bff76cf670806886beac.tar.gz
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) (cherry picked from commit 0c43f96330f2935805ba4f0f8f858a027a90bc4c) (cherry picked from commit caaf59383ceabdc555f7db098dae0455dea65023)
Diffstat (limited to 'source')
-rw-r--r--source/libsmb/namequery.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c
index 5945683236c..3335f5a599b 100644
--- a/source/libsmb/namequery.c
+++ b/source/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;