]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:winbind: Only ever handle one event after a select call
authorVolker Lendecke <vl@samba.org>
Wed, 7 Oct 2009 13:53:46 +0000 (15:53 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 8 Oct 2009 10:27:29 +0000 (12:27 +0200)
While handling an fd event, the situation with other fds can change. I've just
seen a winbind stuck in the accept() call on the privileged pipe. I can only
imagine this happen because under high load we first handled other requests and
meanwhile the client on the privileged pipe went away.

source/winbindd/winbindd.c

index 9005e6754d911357ab91e7025db547876bf6ba09..1d618e263174d4ea365b82c96e8eafea1e817a8f 100644 (file)
@@ -847,7 +847,9 @@ static void process_loop(void)
 
        message_dispatch(winbind_messaging_context());
 
-       run_events(winbind_event_context(), 0, NULL, NULL);
+       if (run_events(winbind_event_context(), 0, NULL, NULL)) {
+               return;
+       }
 
        /* refresh the trusted domain cache */
 
@@ -927,8 +929,10 @@ static void process_loop(void)
                        flags |= EVENT_FD_READ;
                if (FD_ISSET(ev->fd, &w_fds))
                        flags |= EVENT_FD_WRITE;
-               if (flags)
+               if (flags) {
                        ev->handler(ev, flags);
+                       return;
+               }
                ev = next;
        }