]> andersk Git - openssh.git/commitdiff
- (dtucker) [channels.c serverloop.c] Apply the bug #1102 workaround to ptys
authordtucker <dtucker>
Sat, 24 Jun 2006 22:25:25 +0000 (22:25 +0000)
committerdtucker <dtucker>
Sat, 24 Jun 2006 22:25:25 +0000 (22:25 +0000)
   only, otherwise sshd can hang exiting non-interactive sessions.

ChangeLog
channels.c
serverloop.c

index c03e172ee868185a049d66dabb00975a6e679a7b..c3b6c2338bc71c397aa222d3922c8abbb47e7efc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+20060625
+ - (dtucker) [channels.c serverloop.c] Apply the bug #1102 workaround to ptys
+   only, otherwise sshd can hang exiting non-interactive sessions.
+
 20060624
  - (dtucker) [configure.ac] Bug #1193: Define PASSWD_NEEDS_USERNAME on Solaris.
    Works around limitation in Solaris' passwd program for changing passwords
index 239e9dd83933266171685be86f0333ca291f912b..9642a56ee5cf06c72d459c8dd5706be7c6b6babe 100644 (file)
@@ -1422,7 +1422,8 @@ channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset)
 #ifndef PTY_ZEROREAD
                if (len <= 0) {
 #else
-               if (len < 0 || (len == 0 && errno != 0)) {
+               if ((!c->isatty && len <= 0) ||
+                   (c->isatty && (len < 0 || (len == 0 && errno != 0)))) {
 #endif
                        debug2("channel %d: read<=0 rfd %d len %d",
                            c->self, c->rfd, len);
index e370f63a3ada40394a870ce9c8e8a6ef2f8f33c7..18f1a10bd175025c6b14df3c93aaec2d9d6467aa 100644 (file)
@@ -394,7 +394,8 @@ process_input(fd_set *readset)
 #ifndef PTY_ZEROREAD
                } else if (len <= 0) {
 #else
-               } else if (len < 0 || (len == 0 && errno != 0)) {
+               } else if ((!isatty(fdout) && len <= 0) ||
+                   (isatty(fdout) && (len < 0 || (len == 0 && errno != 0)))) {
 #endif
                        fdout_eof = 1;
                } else {
@@ -411,7 +412,8 @@ process_input(fd_set *readset)
 #ifndef PTY_ZEROREAD
                } else if (len <= 0) {
 #else
-               } else if (len < 0 || (len == 0 && errno != 0)) {
+               } else if ((!isatty(fderr) && len <= 0) ||
+                   (isatty(fderr) && (len < 0 || (len == 0 && errno != 0)))) {
 #endif
                        fderr_eof = 1;
                } else {
This page took 1.364934 seconds and 5 git commands to generate.