1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-31 20:22:15 +03:00

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 c127367b1d)
This commit is contained in:
Stefan Metzmacher
2008-10-27 09:40:25 +01:00
parent 7f779450cb
commit 0c43f96330

View File

@ -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;