summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-12-30 09:17:20 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-05 15:07:33 +0100
commit94c4376b497445435edc3e02292b1326a05d1d1e (patch)
tree54ddeb609fa987dbf2ecf627c2c0e027c85c940b
parentf81f21c09b7792915b68cca410e6ec3eb7ee2e0a (diff)
downloadsamba-94c4376b497445435edc3e02292b1326a05d1d1e.tar.gz
samba-94c4376b497445435edc3e02292b1326a05d1d1e.tar.bz2
samba-94c4376b497445435edc3e02292b1326a05d1d1e.zip
s3:winbindd: cancel all ccache entry events and not just one
cancel_named_event() is stupid by design and also only cancels one single event. metze
-rw-r--r--source3/winbindd/winbindd_cred_cache.c14
-rw-r--r--source3/winbindd/winbindd_dual.c10
-rw-r--r--source3/winbindd/winbindd_proto.h1
3 files changed, 19 insertions, 6 deletions
diff --git a/source3/winbindd/winbindd_cred_cache.c b/source3/winbindd/winbindd_cred_cache.c
index e9e9e4dd12..fcb3d033a6 100644
--- a/source3/winbindd/winbindd_cred_cache.c
+++ b/source3/winbindd/winbindd_cred_cache.c
@@ -75,6 +75,20 @@ static int ccache_entry_count(void)
return i;
}
+void ccache_remove_all_after_fork(void)
+{
+ struct WINBINDD_CCACHE_ENTRY *cur, *next;
+
+ for (cur = ccache_list; cur; cur = next) {
+ next = cur->next;
+ DLIST_REMOVE(ccache_list, cur);
+ TALLOC_FREE(cur->event);
+ TALLOC_FREE(cur);
+ }
+
+ return;
+}
+
/****************************************************************
Do the work of refreshing the ticket.
****************************************************************/
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index 42e43e8cf3..b6af796a87 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1206,6 +1206,10 @@ static bool fork_domain_child(struct winbindd_child *child)
close_conns_after_fork();
+ /* Ensure we're not handling an event inherited from
+ our parent. */
+ ccache_remove_all_after_fork();
+
if (!override_logfile) {
lp_set_logfile(child->logfilename);
reopen_logs();
@@ -1269,12 +1273,6 @@ static bool fork_domain_child(struct winbindd_child *child)
}
}
- /* Ensure we're not handling an event inherited from
- our parent. */
-
- cancel_named_event(winbind_event_context(),
- "krb5_ticket_refresh_handler");
-
/* We might be in the idmap child...*/
if (child->domain && !(child->domain->internal) &&
lp_winbind_offline_logon()) {
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 64024660e6..8b0943423d 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -243,6 +243,7 @@ bool ccache_entry_exists(const char *username);
bool ccache_entry_identical(const char *username,
uid_t uid,
const char *ccname);
+void ccache_remove_all_after_fork(void);
NTSTATUS add_ccache_to_list(const char *princ_name,
const char *ccname,
const char *service,