summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/clientloop.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2013-06-07 15:37:53 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2013-06-07 15:37:53 +0000
commitfb5755809e7db58c1fac402988fd532351d5e50d (patch)
tree3fabc7cb4ea575315018199c30750f81e381303f /usr.bin/ssh/clientloop.c
parent5b0ca71ede905ed03ec6fc2e0528484360734b09 (diff)
Add an "ABANDONED" channel state and use for mux sessions that are
disconnected via the ~. escape sequence. Channels in this state will be able to close if the server responds, but do not count as active channels. This means that if you ~. all of the mux clients when using ControlPersist on a broken network, the backgrounded mux master will exit when the Control Persist time expires rather than hanging around indefinitely. bz#1917, also reported and tested by tedu@. ok djm@ markus@.
Diffstat (limited to 'usr.bin/ssh/clientloop.c')
-rw-r--r--usr.bin/ssh/clientloop.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c
index cffb2fe81a0..ba6dd36705b 100644
--- a/usr.bin/ssh/clientloop.c
+++ b/usr.bin/ssh/clientloop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.252 2013/06/02 23:36:29 dtucker Exp $ */
+/* $OpenBSD: clientloop.c,v 1.253 2013/06/07 15:37:52 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1102,6 +1102,9 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr,
chan_write_failed(c);
if (c->detach_user)
c->detach_user(c->self, NULL);
+ c->type = SSH_CHANNEL_ABANDONED;
+ buffer_clear(&c->input);
+ chan_ibuf_empty(c);
return 0;
} else
quit_pending = 1;