diff options
author | Darren Tucker <dtucker@zip.com.au> | 2010-01-08 17:08:35 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2010-01-08 17:08:35 +1100 |
commit | 2944082b3f84b5260a748a529f90cd18a6187610 (patch) | |
tree | 1d38062fa7cdc0cbd6f07406760adf94c631feed | |
parent | 876045b0fb273ee11b02c535833b076c875253dc (diff) |
- djm@cvs.openbsd.org 2009/11/17 05:31:44
[clientloop.c]
fix incorrect exit status when multiplexing and channel ID 0 is recycled
bz#1570 reported by peter.oliver AT eon-is.co.uk; ok dtucker
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | clientloop.c | 14 |
2 files changed, 12 insertions, 6 deletions
@@ -57,6 +57,10 @@ | |||
57 | the end of the select read/write fdset and make sure a reused FD | 57 | the end of the select read/write fdset and make sure a reused FD |
58 | is not touched before the pre-handlers are called. | 58 | is not touched before the pre-handlers are called. |
59 | with and ok djm@ | 59 | with and ok djm@ |
60 | - djm@cvs.openbsd.org 2009/11/17 05:31:44 | ||
61 | [clientloop.c] | ||
62 | fix incorrect exit status when multiplexing and channel ID 0 is recycled | ||
63 | bz#1570 reported by peter.oliver AT eon-is.co.uk; ok dtucker | ||
60 | 64 | ||
61 | 20091226 | 65 | 20091226 |
62 | - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1 | 66 | - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1 |
diff --git a/clientloop.c b/clientloop.c index 540a6181a..eca87777f 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.214 2009/10/24 11:15:29 andreas Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.215 2009/11/17 05:31:44 djm 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 |
@@ -1856,15 +1856,17 @@ client_input_channel_req(int type, u_int32_t seq, void *ctxt) | |||
1856 | chan_rcvd_eow(c); | 1856 | chan_rcvd_eow(c); |
1857 | } else if (strcmp(rtype, "exit-status") == 0) { | 1857 | } else if (strcmp(rtype, "exit-status") == 0) { |
1858 | exitval = packet_get_int(); | 1858 | exitval = packet_get_int(); |
1859 | if (id == session_ident) { | 1859 | if (c->ctl_fd != -1) { |
1860 | /* Dispatch to mux client */ | ||
1861 | atomicio(vwrite, c->ctl_fd, &exitval, sizeof(exitval)); | ||
1862 | success = 1; | ||
1863 | } else if (id == session_ident) { | ||
1864 | /* Record exit value of local session */ | ||
1860 | success = 1; | 1865 | success = 1; |
1861 | exit_status = exitval; | 1866 | exit_status = exitval; |
1862 | } else if (c->ctl_fd == -1) { | 1867 | } else { |
1863 | error("client_input_channel_req: unexpected channel %d", | 1868 | error("client_input_channel_req: unexpected channel %d", |
1864 | session_ident); | 1869 | session_ident); |
1865 | } else { | ||
1866 | atomicio(vwrite, c->ctl_fd, &exitval, sizeof(exitval)); | ||
1867 | success = 1; | ||
1868 | } | 1870 | } |
1869 | packet_check_eom(); | 1871 | packet_check_eom(); |
1870 | } | 1872 | } |