]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
sshd don't exit on transient read errors
authorDamien Miller <djm@mindrot.org>
Wed, 14 Apr 2021 01:42:55 +0000 (11:42 +1000)
committerDamien Miller <djm@mindrot.org>
Wed, 14 Apr 2021 01:42:55 +0000 (11:42 +1000)
openssh-8.5 introduced a regression that would cause sshd to exit
because of transient read errors on the network socket (e.g. EINTR,
EAGAIN). Reported by balu.gajjala AT gmail.com via bz3297

serverloop.c

index 6691797185555d1d4b0e01e25b4fb173299f2eae..70a20ab496fcc3a0c364e7ce6511c99220ca6d17 100644 (file)
@@ -333,7 +333,7 @@ process_input(struct ssh *ssh, fd_set *readset, int connection_in)
                        return -1;
                } else if (len == -1) {
                        if (errno == EINTR || errno == EAGAIN ||
-                           errno != EWOULDBLOCK)
+                           errno == EWOULDBLOCK)
                                return 0;
                        verbose("Read error from remote host %s port %d: %s",
                            ssh_remote_ipaddr(ssh), ssh_remote_port(ssh),