From dc582af6e7a1e645402f333e200b8ff718de1b48 Mon Sep 17 00:00:00 2001 From: Timo Weingärtner Date: Tue, 23 Aug 2016 22:03:43 +0200 Subject: clear O_NONBLOCK on client sockets on *BSD client sockets inherit flags from the listening socket --- ssh-agent-filter.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ssh-agent-filter.C b/ssh-agent-filter.C index 1dcbb5c..30aaf9a 100644 --- a/ssh-agent-filter.C +++ b/ssh-agent-filter.C @@ -497,6 +497,9 @@ rfc4251::string handle_request (rfc4251::string const & r) { } void handle_client (int const sock) try { + if (fcntl(sock, F_SETFL, fcntl(sock, F_GETFL) & ~O_NONBLOCK)) + throw system_error(errno, system_category(), "fcntl"); + io::stream client{sock, io::close_handle}; arm(client); -- cgit v1.2.3