1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

s3:libsmb: ads_dc_name() doesn't need to retry if we found a DC in the closest site

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Stefan Metzmacher 2024-09-26 19:14:40 +02:00
parent 25a6e1c8e7
commit 56fc50b0aa

View File

@ -60,7 +60,7 @@ static bool ads_dc_name(const char *domain,
TALLOC_CTX *tmp_ctx = talloc_stackframe();
bool ok = false;
ADS_STRUCT *ads;
char *sitename;
const char *sitename;
int i;
char addr[INET6_ADDRSTRLEN];
@ -94,6 +94,11 @@ static bool ads_dc_name(const char *domain,
has changed. If so, we need to re-do the DNS query
to ensure we only find servers in our site. */
#ifdef HAVE_ADS
if (ads_closest_dc(ads)) {
sitename = ads->config.client_site_name;
} else
#endif
if (stored_sitename_changed(realm, sitename)) {
sitename = sitename_fetch(tmp_ctx, realm);
TALLOC_FREE(ads);