summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2010-01-08 17:08:35 +1100
committerDarren Tucker <dtucker@zip.com.au>2010-01-08 17:08:35 +1100
commit2944082b3f84b5260a748a529f90cd18a6187610 (patch)
tree1d38062fa7cdc0cbd6f07406760adf94c631feed /clientloop.c
parent876045b0fb273ee11b02c535833b076c875253dc (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
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c14
1 files changed, 8 insertions, 6 deletions
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 }