summaryrefslogtreecommitdiff
path: root/source3/libsmb/namequery_dc.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-10-11 18:54:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:25 -0500
commit37be6913fefcd9988f6c15a7b24a0a3429851ea6 (patch)
tree31293060b457375b6f32132944134f9f3e6ca7d3 /source3/libsmb/namequery_dc.c
parenta0dd125859e4e118c8bc3c2da258d69868aa786c (diff)
downloadsamba-37be6913fefcd9988f6c15a7b24a0a3429851ea6.tar.gz
samba-37be6913fefcd9988f6c15a7b24a0a3429851ea6.tar.bz2
samba-37be6913fefcd9988f6c15a7b24a0a3429851ea6.zip
r19249: Attempt to fix a site lookup bug found by Guenther.
- "The problem is, with a fresh system, we don't know our sitename, therefor we do a stupid DNS query for all DCs. The reply we get is a round-robin list of all 21 DCs, we just pick the first, contact that and safe that INET.COM#1C query in the name cache for later use... What we need to do if we don't yet know our sitename, is to contact to any DC, get the CLDAP reply to tell us in which site we are, then flush the namecache and requery DNS including the sitename" Implement the flushing of the #1C entries for a given NetBIOS name/realm when looking up the site value. Jeremy. (This used to be commit b2d1e44f59d32c91b1d48eacd1a158ba7b65762d)
Diffstat (limited to 'source3/libsmb/namequery_dc.c')
-rw-r--r--source3/libsmb/namequery_dc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/libsmb/namequery_dc.c b/source3/libsmb/namequery_dc.c
index cf01fb269e..5280118ab8 100644
--- a/source3/libsmb/namequery_dc.c
+++ b/source3/libsmb/namequery_dc.c
@@ -72,6 +72,9 @@ static BOOL ads_dc_name(const char *domain,
SAFE_FREE(sitename);
sitename = sitename_fetch();
ads_destroy(&ads);
+ /* Ensure we don't cache the DC we just connected to. */
+ namecache_delete(realm, 0x1C);
+ namecache_delete(domain, 0x1C);
continue;
}