diff options
author | Günther Deschner <gd@samba.org> | 2007-01-18 09:58:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:17:16 -0500 |
commit | e9c294b926c0b831fd936194342ec0564f935798 (patch) | |
tree | 3a418a506576d1dbfc12438608293a1e7b708989 /source3/libsmb | |
parent | fd37f98158161406229b728a7c767121a30e254f (diff) | |
download | samba-e9c294b926c0b831fd936194342ec0564f935798.tar.gz samba-e9c294b926c0b831fd936194342ec0564f935798.tar.bz2 samba-e9c294b926c0b831fd936194342ec0564f935798.zip |
r20874: We need to distinguish client sitenames per realm. We were overwriting
the stored client sitename with the sitename from each sucessfull CLDAP
connection.
Guenther
(This used to be commit 6a13e878b5d299cb3b3d7cb33ee0d51089d9228d)
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); |