Fix a race condition in winbind leading to a panic
[ira/wip.git] / source3 / winbindd / winbindd.c
index 52517b01bbe823a70b7f74a6869c4ec7b3580a9f..e1ce2234759dd9b26be7432a586e6e3abbf07cb2 100644 (file)
@@ -905,6 +905,7 @@ static bool remove_idle_client(void)
 
        for (state = winbindd_client_list(); state; state = state->next) {
                if (state->response.result != WINBINDD_PENDING &&
+                   state->fd_event.flags == EVENT_FD_READ &&
                    !state->getpwent_state && !state->getgrent_state) {
                        nidle++;
                        if (!last_access || state->last_access < last_access) {