summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-20 07:42:21 +1000
committerDamien Miller <djm@mindrot.org>2000-04-20 07:42:21 +1000
commit166fca8894807de71b741a779330bd23edfec013 (patch)
tree387371567ce5b3c89c52e18f3a22348f1456af8d /session.c
parent3ef692aa05a4b0d94a114be0826d32d0c8f67f1b (diff)
downloadopenssh-git-166fca8894807de71b741a779330bd23edfec013.tar.gz
- Sync with OpenBSD CVS:
[clientloop.c login.c serverloop.c ssh-agent.c ssh.h sshconnect.c sshd.c] - pid_t [session.c] - remove bogus chan_read_failed. this could cause data corruption (missing data) at end of a SSH2 session.
Diffstat (limited to 'session.c')
-rw-r--r--session.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/session.c b/session.c
index 24bc25c6..840a4e9e 100644
--- a/session.c
+++ b/session.c
@@ -8,7 +8,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.4 2000/04/14 10:30:33 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.5 2000/04/19 09:24:39 markus Exp $");
#include "xmalloc.h"
#include "ssh.h"
@@ -1388,8 +1388,12 @@ session_exit_message(Session *s, int status)
/* disconnect channel */
debug("session_exit_message: release channel %d", s->chanid);
channel_cancel_cleanup(s->chanid);
- if (c->istate == CHAN_INPUT_OPEN)
- chan_read_failed(c);
+ /*
+ * 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
+ * be some more data waiting in the pipe.
+ */
chan_write_failed(c);
s->chanid = -1;
}