diff options
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/namequery.c | 2 | ||||
-rw-r--r-- | source3/libsmb/namequery_dc.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 1f32d3bc37..cbd94ff567 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -1311,7 +1311,7 @@ BOOL internal_resolve_name(const char *name, int name_type, BOOL resolve_name(const char *name, struct in_addr *return_ip, int name_type) { struct ip_service *ip_list = NULL; - char *sitename = sitename_fetch(); + char *sitename = sitename_fetch(lp_realm()); /* wild guess */ int count = 0; if (is_ipaddress(name)) { diff --git a/source3/libsmb/namequery_dc.c b/source3/libsmb/namequery_dc.c index a240510b77..110b9986b7 100644 --- a/source3/libsmb/namequery_dc.c +++ b/source3/libsmb/namequery_dc.c @@ -53,13 +53,15 @@ static BOOL ads_dc_name(const char *domain, fstring srv_name) { ADS_STRUCT *ads; - char *sitename = sitename_fetch(); + char *sitename; int i; if (!realm && strequal(domain, lp_workgroup())) { realm = lp_realm(); } + sitename = sitename_fetch(realm); + /* Try this 3 times then give up. */ for( i =0 ; i < 3; i++) { ads = ads_init(realm, domain, NULL); @@ -86,9 +88,9 @@ 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. */ - if (stored_sitename_changed(sitename)) { + if (stored_sitename_changed(realm, sitename)) { SAFE_FREE(sitename); - sitename = sitename_fetch(); + sitename = sitename_fetch(realm); ads_destroy(&ads); /* Ensure we don't cache the DC we just connected to. */ namecache_delete(realm, 0x1C); |