summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-09-03 03:46:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:39:48 -0500
commit98cfbd3ccfb3d2255a65289410e5e358ff3d1a64 (patch)
tree8fca683ce2de27756122271f973477a8db9b09fe /source3/libads
parent6fc90da054e06ac4f9db673e237faed6ccc88207 (diff)
downloadsamba-98cfbd3ccfb3d2255a65289410e5e358ff3d1a64.tar.gz
samba-98cfbd3ccfb3d2255a65289410e5e358ff3d1a64.tar.bz2
samba-98cfbd3ccfb3d2255a65289410e5e358ff3d1a64.zip
r18015: Try and detect network failures immediately in
set_dc_type_and_flags(). Fix problem when DC is down in ads_connect, where we fall back to NetBIOS and try exactly the same IP addresses we just put in the negative connection cache.... We can never succeed, so don't try lookups a second time. Jeremy. (This used to be commit 2d28f3e94a1a87bc9e9ed6630ef48b1ce17022e8)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ldap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index b23bc277e8..a02f954360 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -286,6 +286,26 @@ again:
if ( !NT_STATUS_IS_OK(check_negative_conn_cache(realm, server)) )
continue;
+
+ if (!got_realm) {
+ /* realm in this case is a workgroup name. We need
+ to ignore any IP addresses in the negative connection
+ cache that match ip addresses returned in the ad realm
+ case. It sucks that I have to reproduce the logic above... */
+ c_realm = ads->server.realm;
+ if ( !c_realm || !*c_realm ) {
+ if ( !ads->server.workgroup || !*ads->server.workgroup ) {
+ c_realm = lp_realm();
+ }
+ }
+ if (c_realm && *c_realm &&
+ !NT_STATUS_IS_OK(check_negative_conn_cache(c_realm, server))) {
+ /* Ensure we add the workgroup name for this
+ IP address as negative too. */
+ add_failed_connection_entry( realm, server, NT_STATUS_UNSUCCESSFUL );
+ continue;
+ }
+ }
if ( ads_try_connect(ads, server) ) {
SAFE_FREE(ip_list);