summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2012-09-06 21:19:05 +1000
committerDarren Tucker <dtucker@zip.com.au>2012-09-06 21:19:05 +1000
commit66cb0e0733782c2f6773abd9fd1d87f5efef6c27 (patch)
tree88b17abef9f6bb7276066ea811fe0acbe09ec7d7
parent3ee50c5d9f95cd40df403cf1a91fdaffefa21cc5 (diff)
- dtucker@cvs.openbsd.org 2012/08/17 00:45:45
[clientloop.c clientloop.h mux.c] Force a clean shutdown of ControlMaster client sessions when the ~. escape sequence is used. This means that ~. should now work in mux clients even if the server is no longer responding. Found by tedu, ok djm.
-rw-r--r--ChangeLog5
-rw-r--r--clientloop.c4
-rw-r--r--clientloop.h3
-rw-r--r--mux.c4
4 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b6803b6a..bdaaa0ae3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,11 @@
4 [ssh-keygen.1] 4 [ssh-keygen.1]
5 a little more info on certificate validity; 5 a little more info on certificate validity;
6 requested by Ross L Richardson, and provided by djm 6 requested by Ross L Richardson, and provided by djm
7 - dtucker@cvs.openbsd.org 2012/08/17 00:45:45
8 [clientloop.c clientloop.h mux.c]
9 Force a clean shutdown of ControlMaster client sessions when the ~. escape
10 sequence is used. This means that ~. should now work in mux clients even
11 if the server is no longer responding. Found by tedu, ok djm.
7 12
820120830 1320120830
9 - (dtucker) [moduli] Import new moduli file. 14 - (dtucker) [moduli] Import new moduli file.
diff --git a/clientloop.c b/clientloop.c
index 1c1a77088..65664cbcd 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.c,v 1.240 2012/06/20 04:42:58 djm Exp $ */ 1/* $OpenBSD: clientloop.c,v 1.241 2012/08/17 00:45:45 dtucker Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1046,6 +1046,8 @@ process_escapes(Channel *c, Buffer *bin, Buffer *bout, Buffer *berr,
1046 if (c && c->ctl_chan != -1) { 1046 if (c && c->ctl_chan != -1) {
1047 chan_read_failed(c); 1047 chan_read_failed(c);
1048 chan_write_failed(c); 1048 chan_write_failed(c);
1049 mux_master_session_cleanup_cb(c->self,
1050 NULL);
1049 return 0; 1051 return 0;
1050 } else 1052 } else
1051 quit_pending = 1; 1053 quit_pending = 1;
diff --git a/clientloop.h b/clientloop.h
index 3bb794879..d2baa0324 100644
--- a/clientloop.h
+++ b/clientloop.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: clientloop.h,v 1.29 2011/09/09 22:46:44 djm Exp $ */ 1/* $OpenBSD: clientloop.h,v 1.30 2012/08/17 00:45:45 dtucker Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -76,4 +76,5 @@ void muxserver_listen(void);
76void muxclient(const char *); 76void muxclient(const char *);
77void mux_exit_message(Channel *, int); 77void mux_exit_message(Channel *, int);
78void mux_tty_alloc_failed(Channel *); 78void mux_tty_alloc_failed(Channel *);
79void mux_master_session_cleanup_cb(int, void *);
79 80
diff --git a/mux.c b/mux.c
index 5e0e65ff3..0f1532bb5 100644
--- a/mux.c
+++ b/mux.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: mux.c,v 1.36 2012/07/06 01:37:21 djm Exp $ */ 1/* $OpenBSD: mux.c,v 1.37 2012/08/17 00:45:45 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2002-2008 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -188,7 +188,7 @@ static const struct {
188 188
189/* Cleanup callback fired on closure of mux slave _session_ channel */ 189/* Cleanup callback fired on closure of mux slave _session_ channel */
190/* ARGSUSED */ 190/* ARGSUSED */
191static void 191void
192mux_master_session_cleanup_cb(int cid, void *unused) 192mux_master_session_cleanup_cb(int cid, void *unused)
193{ 193{
194 Channel *cc, *c = channel_by_id(cid); 194 Channel *cc, *c = channel_by_id(cid);