so-called-hang-on-exit

Markus Friedl markus at openbsd.org
Thu Aug 1 02:35:47 EST 2002


so, should this go into 3.5?

Index: serverloop.c
===================================================================
RCS file: /home/markus/cvs/ssh/serverloop.c,v
retrieving revision 1.103
diff -u -r1.103 serverloop.c
--- serverloop.c	24 Jun 2002 14:33:27 -0000	1.103
+++ serverloop.c	12 Jul 2002 16:34:20 -0000
@@ -388,6 +388,11 @@
 			buffer_append(&stderr_buffer, buf, len);
 		}
 	}
+	/* allow data loss on pty */
+	if (child_terminated && fderr == -1 && !fdout_eof) {
+		close(fdout);
+		fdout_eof = 1;
+	}
 }
 
 /*
Index: session.c
===================================================================
RCS file: /home/markus/cvs/ssh/session.c,v
retrieving revision 1.143
diff -u -r1.143 session.c
--- session.c	30 Jun 2002 21:54:16 -0000	1.143
+++ session.c	12 Jul 2002 16:35:32 -0000
@@ -1629,11 +1629,15 @@
 	/*
 	 * emulate a write failure with 'chan_write_failed', nobody will be
 	 * interested in data we write.
-	 * Note that we must not call 'chan_read_failed', since there could
+	 * Note that for the non-pty case we must not call 'chan_read_failed',
+	 * since there could
 	 * be some more data waiting in the pipe.
 	 */
 	if (c->ostate != CHAN_OUTPUT_CLOSED)
 		chan_write_failed(c);
+	/* allow data loss on pty */
+	if (s->ttyfd != -1 && c->istate == CHAN_INPUT_OPEN)
+		chan_read_failed(c);       
 	s->chanid = -1;
 }
 



More information about the openssh-unix-dev mailing list