]> andersk Git - openssh.git/commitdiff
- djm@cvs.openbsd.org 2009/11/17 05:31:44
authordtucker <dtucker>
Fri, 8 Jan 2010 06:08:35 +0000 (06:08 +0000)
committerdtucker <dtucker>
Fri, 8 Jan 2010 06:08:35 +0000 (06:08 +0000)
     [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

ChangeLog
clientloop.c

index 96e338c003535f2bb63deb64e6904e0c8ea093cd..72d5a21e1cc598ba583597dfb1aff5ba3c8c1038 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      the end of the select read/write fdset and make sure a reused FD
      is not touched before the pre-handlers are called.
      with and ok djm@
+   - 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
 
 20091226
  - (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1
index 540a6181ad30a8d89e7acff6a592fe64fcfc4dc4..eca87777f95102cbe471d2731eb557077a48270c 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.214 2009/10/24 11:15:29 andreas Exp $ */
+/* $OpenBSD: clientloop.c,v 1.215 2009/11/17 05:31:44 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * 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)
                chan_rcvd_eow(c);
        } else if (strcmp(rtype, "exit-status") == 0) {
                exitval = packet_get_int();
-               if (id == session_ident) {
+               if (c->ctl_fd != -1) {
+                       /* Dispatch to mux client */
+                       atomicio(vwrite, c->ctl_fd, &exitval, sizeof(exitval));
+                       success = 1;
+               } else if (id == session_ident) {
+                       /* Record exit value of local session */
                        success = 1;
                        exit_status = exitval;
-               } else if (c->ctl_fd == -1) {
+               } else {
                        error("client_input_channel_req: unexpected channel %d",
                            session_ident);
-               } else {
-                       atomicio(vwrite, c->ctl_fd, &exitval, sizeof(exitval));
-                       success = 1;
                }
                packet_check_eom();
        }
This page took 0.046028 seconds and 5 git commands to generate.