summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-06-25 19:00:15 +0000
committerGerald Carter <jerry@samba.org>2003-06-25 19:00:15 +0000
commit72876b79c9b3f0ab3cda6de42d5c8995aadd687e (patch)
treee8812346edaf22118010c0d47adfb96b01e6623a
parent9e2f008bb99af8fd83136cbd8e5a785d5348276b (diff)
downloadsamba-72876b79c9b3f0ab3cda6de42d5c8995aadd687e.tar.gz
samba-72876b79c9b3f0ab3cda6de42d5c8995aadd687e.tar.bz2
samba-72876b79c9b3f0ab3cda6de42d5c8995aadd687e.zip
* fix typos in a few debug statements
* check negative connection cache before ads_try_connect() in ads_find_dc() (This used to be commit 2a76101a3a31f5fca2f444b25e3f0486f7ef406f)
-rw-r--r--source3/libads/ldap.c12
-rw-r--r--source3/libsmb/conncache.c2
-rw-r--r--source3/nsswitch/winbindd_cm.c2
3 files changed, 11 insertions, 5 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index a168f75e98..60bbef821c 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -130,7 +130,7 @@ again:
pstrcpy( realm, c_realm );
- DEBUG(6,("ads_try_dns: looking for %s realm '%s'\n",
+ DEBUG(6,("ads_find_dc: looking for %s '%s'\n",
(got_realm ? "realm" : "domain"), realm));
if ( !get_sorted_dc_list(realm, &ip_list, &count, got_realm) ) {
@@ -147,14 +147,20 @@ again:
for ( i=0; i<count; i++ ) {
/* since this is an ads conection request, default to LDAP_PORT is not set */
int port = (ip_list[i].port!=PORT_NONE) ? ip_list[i].port : LDAP_PORT;
+ fstring server;
- if ( ads_try_connect(ads, inet_ntoa(ip_list[i].ip), port) ) {
+ fstrcpy( server, inet_ntoa(ip_list[i].ip) );
+
+ if ( !NT_STATUS_IS_OK(check_negative_conn_cache(realm, server)) )
+ continue;
+
+ if ( ads_try_connect(ads, server, port) ) {
SAFE_FREE(ip_list);
return True;
}
/* keep track of failures */
- add_failed_connection_entry( realm, inet_ntoa(ip_list[i].ip), NT_STATUS_UNSUCCESSFUL );
+ add_failed_connection_entry( realm, server, NT_STATUS_UNSUCCESSFUL );
}
SAFE_FREE(ip_list);
diff --git a/source3/libsmb/conncache.c b/source3/libsmb/conncache.c
index ab0501b0be..da31e25a9c 100644
--- a/source3/libsmb/conncache.c
+++ b/source3/libsmb/conncache.c
@@ -107,7 +107,7 @@ void add_failed_connection_entry(const char *domain, const char *server, NTSTATU
for (fcc = failed_connection_cache; fcc; fcc = fcc->next) {
if ( strequal(fcc->domain_name, domain) && strequal(fcc->controller, server) )
{
- DEBUG(10, ("add_failed_connection_entry_byname: domain %s (%s) already tried and failed\n",
+ DEBUG(10, ("add_failed_connection_entry: domain %s (%s) already tried and failed\n",
domain, server ));
return;
}
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index befd1d562c..9f5bf3f11a 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -94,7 +94,7 @@ static BOOL ads_dc_name(const char *domain, struct in_addr *dc_ip, fstring srv_n
/* we don't need to bind, just connect */
ads->auth.flags |= ADS_AUTH_NO_BIND;
- DEBUG(4,("cm_ads_find_dc: domain=%s\n", domain));
+ DEBUG(4,("ads_dc_name: domain=%s\n", domain));
#ifdef HAVE_ADS
/* a full ads_connect() is actually overkill, as we don't srictly need