summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/conncache.c28
-rw-r--r--source3/nsswitch/winbindd_dual.c4
2 files changed, 30 insertions, 2 deletions
diff --git a/source3/libsmb/conncache.c b/source3/libsmb/conncache.c
index 49512d7a2e..b8ddcb2ba9 100644
--- a/source3/libsmb/conncache.c
+++ b/source3/libsmb/conncache.c
@@ -162,3 +162,31 @@ void flush_negative_conn_cache( void )
}
}
+
+/****************************************************************************
+ Remove all negative entries for a domain. Used when going to online state in
+ winbindd.
+****************************************************************************/
+
+void flush_negative_conn_cache_for_domain(const char *domain)
+{
+ struct failed_connection_cache *fcc;
+
+ fcc = failed_connection_cache;
+
+ while (fcc) {
+ struct failed_connection_cache *fcc_next;
+
+ fcc_next = fcc->next;
+
+ if (strequal(fcc->domain_name, domain)) {
+ DEBUG(10,("flush_negative_conn_cache_for_domain: removed server %s "
+ " from failed cache for domain %s\n",
+ fcc->controller, domain));
+ DLIST_REMOVE(failed_connection_cache, fcc);
+ free(fcc);
+ }
+
+ fcc = fcc_next;
+ }
+}
diff --git a/source3/nsswitch/winbindd_dual.c b/source3/nsswitch/winbindd_dual.c
index db21132a80..659242e918 100644
--- a/source3/nsswitch/winbindd_dual.c
+++ b/source3/nsswitch/winbindd_dual.c
@@ -584,9 +584,9 @@ static void child_msg_offline(int msg_type, struct process_id src, void *buf, si
static void winbindd_flush_negative_conn_cache(struct winbindd_domain *domain)
{
- check_negative_conn_cache_timeout(domain->name, domain->dcname, 0);
+ flush_negative_conn_cache_for_domain(domain->name);
if (*domain->alt_name) {
- check_negative_conn_cache_timeout(domain->alt_name, domain->dcname, 0);
+ flush_negative_conn_cache_for_domain(domain->alt_name);
}
}