diff --git a/install_with_python.sh b/install_with_python.sh old mode 100644 new mode 100755 diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 248f747..dfaa60d 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -932,8 +932,22 @@ static bool remove_idle_client(void) struct winbindd_cli_state *state, *remove_state = NULL; time_t last_access = 0; int nidle = 0; + int count =0; + int i = 0; + + struct winbindd_cli_state* state_arr[50]; + for (i = 0; i < 50 ; i++) { + state_arr[i] = NULL; + } + for (state = winbindd_client_list(); state; state = state->next) { + + if (state->pid && (kill(state->pid, 0) == -1) && (count<50)) { + DEBUG(5,("Found dead client - %d and pid %u\n",count, state->pid)); + state_arr[count++] = state; + } + if (client_is_idle(state)) { nidle++; if (!last_access || state->last_access < last_access) { @@ -943,6 +957,15 @@ static bool remove_idle_client(void) } } + if (count) { + for (i=0; i<50; i++) { + if (state_arr[i] && (state_arr[i] != remove_state) ) { + DEBUG(5,("Removing client - %d and pid %u\n",i, state_arr[i]->pid)); + remove_client(state_arr[i]); + } + } + } + if (remove_state) { DEBUG(5,("Found %d idle client connections, shutting down sock %d, pid %u\n", nidle, remove_state->sock, (unsigned int)remove_state->pid));