Make the sudo side of the intercept socket non-blocking.
This commit is contained in:
@@ -854,7 +854,7 @@ intercept_accept_cb(int fd, int what, void *v)
|
|||||||
struct sudo_event_base *evbase = sudo_ev_get_base(&closure->ev);
|
struct sudo_event_base *evbase = sudo_ev_get_base(&closure->ev);
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
socklen_t sin_len = sizeof(sin);
|
socklen_t sin_len = sizeof(sin);
|
||||||
int client_sock;
|
int client_sock, flags;
|
||||||
debug_decl(intercept_accept_cb, SUDO_DEBUG_EXEC);
|
debug_decl(intercept_accept_cb, SUDO_DEBUG_EXEC);
|
||||||
|
|
||||||
if (closure->state != RECV_CONNECTION) {
|
if (closure->state != RECV_CONNECTION) {
|
||||||
@@ -870,6 +870,9 @@ intercept_accept_cb(int fd, int what, void *v)
|
|||||||
sudo_warn("accept");
|
sudo_warn("accept");
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
|
flags = fcntl(client_sock, F_GETFL, 0);
|
||||||
|
if (flags != -1)
|
||||||
|
(void)fcntl(client_sock, F_SETFL, flags | O_NONBLOCK);
|
||||||
|
|
||||||
if (!intercept_setup(client_sock, evbase, closure->details)) {
|
if (!intercept_setup(client_sock, evbase, closure->details)) {
|
||||||
goto bad;
|
goto bad;
|
||||||
|
Reference in New Issue
Block a user