From a526a1315fb63b7b3300342ccddf491904ebc185 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Aug 2012 15:21:26 -0700 Subject: [PATCH 1/2] Ensure we keep last_access up to date when processing a request. --- source3/winbindd/winbindd.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index ca5a53b..a990342 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -566,6 +566,7 @@ static void process_request(struct winbindd_cli_state *state) state->cmd_name = "unknown request"; state->recv_fn = NULL; + state->last_access = time(NULL); /* Process command */ -- 1.7.7.3 From 8e1ae4e26115e42dd9e1fc5c13daa0339efd2c18 Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Mon, 20 Aug 2012 16:03:28 -0700 Subject: [PATCH 2/2] Fix bug #9104 - winbindd can mis-identify idle clients - can cause crashes and NDR parsing errors. A connection is idle when both struct winbindd_cli_state->request AND struct winbindd_cli_state->response are NULL. Otherwise we can flag as idle a connection in the state of having sent the request to the winbindd child (request != NULL) but not yet received a reply (response == NULL). --- source3/winbindd/winbindd.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index a990342..4442c73 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -872,7 +872,8 @@ static bool remove_idle_client(void) int nidle = 0; for (state = winbindd_client_list(); state; state = state->next) { - if (state->response == NULL && + if (state->request == NULL && + state->response == NULL && !state->pwent_state && !state->grent_state) { nidle++; if (!last_access || state->last_access < last_access) { -- 1.7.7.3