Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssh/dist PR/52604: Tatoku Ogaito: Fi...



details:   https://anonhg.NetBSD.org/src/rev/8024cc755771
branches:  trunk
changeset: 356724:8024cc755771
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Oct 09 12:07:03 2017 +0000

description:
PR/52604: Tatoku Ogaito: Fix x11 session forwarding.

diffstat:

 crypto/external/bsd/openssh/dist/channels.c |  21 +++++++++++++--------
 crypto/external/bsd/openssh/dist/packet.c   |   9 +++++----
 2 files changed, 18 insertions(+), 12 deletions(-)

diffs (91 lines):

diff -r 9efb90a02a04 -r 8024cc755771 crypto/external/bsd/openssh/dist/channels.c
--- a/crypto/external/bsd/openssh/dist/channels.c       Mon Oct 09 10:31:50 2017 +0000
+++ b/crypto/external/bsd/openssh/dist/channels.c       Mon Oct 09 12:07:03 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: channels.c,v 1.19 2017/10/07 19:39:19 christos Exp $   */
+/*     $NetBSD: channels.c,v 1.20 2017/10/09 12:07:03 christos Exp $   */
 /* $OpenBSD: channels.c,v 1.375 2017/09/24 13:45:34 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
@@ -41,7 +41,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: channels.c,v 1.19 2017/10/07 19:39:19 christos Exp $");
+__RCSID("$NetBSD: channels.c,v 1.20 2017/10/09 12:07:03 christos Exp $");
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -3733,10 +3733,11 @@
                    "streamlocal-forward%openssh.com@localhost")) != 0 ||
                    (r = sshpkt_put_u8(ssh, 1)) != 0 || /* want reply */
                    (r = sshpkt_put_cstring(ssh, fwd->listen_path)) != 0 ||
-                   (r = sshpkt_send(ssh)) != 0 ||
-                   (r = ssh_packet_write_wait(ssh)) != 0)
+                   (r = sshpkt_send(ssh)) != 0)
                        fatal("%s: request streamlocal: %s",
                            __func__, ssh_err(r));
+               if ((r = ssh_packet_write_wait(ssh)) < 0)
+                       sshpkt_fatal(ssh, __func__, r);
        } else {
                if ((r = sshpkt_start(ssh, SSH2_MSG_GLOBAL_REQUEST)) != 0 ||
                    (r = sshpkt_put_cstring(ssh, "tcpip-forward")) != 0 ||
@@ -3744,10 +3745,11 @@
                    (r = sshpkt_put_cstring(ssh,
                    channel_rfwd_bind_host(fwd->listen_host))) != 0 ||
                    (r = sshpkt_put_u32(ssh, fwd->listen_port)) != 0 ||
-                   (r = sshpkt_send(ssh)) != 0 ||
-                   (r = ssh_packet_write_wait(ssh)) != 0)
+                   (r = sshpkt_send(ssh)) != 0)
                        fatal("%s: request tcpip-forward: %s",
                            __func__, ssh_err(r));
+               if ((r = ssh_packet_write_wait(ssh)) < 0)
+                       sshpkt_fatal(ssh, __func__, r);
        }
        /* Assume that server accepts the request */
        success = 1;
@@ -4691,8 +4693,11 @@
            (r = sshpkt_put_cstring(ssh, proto)) != 0 ||
            (r = sshpkt_put_cstring(ssh, new_data)) != 0 ||
            (r = sshpkt_put_u32(ssh, screen_number)) != 0 ||
-           (r = sshpkt_send(ssh)) != 0 ||
-           (r = ssh_packet_write_wait(ssh)) != 0)
+           (r = sshpkt_send(ssh)) != 0)
                fatal("%s: send x11-req: %s", __func__, ssh_err(r));
+
+       if ((r = ssh_packet_write_wait(ssh)) < 0)
+               sshpkt_fatal(ssh, __func__, r);
+
        free(new_data);
 }
diff -r 9efb90a02a04 -r 8024cc755771 crypto/external/bsd/openssh/dist/packet.c
--- a/crypto/external/bsd/openssh/dist/packet.c Mon Oct 09 10:31:50 2017 +0000
+++ b/crypto/external/bsd/openssh/dist/packet.c Mon Oct 09 12:07:03 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: packet.c,v 1.28 2017/10/07 19:39:19 christos Exp $     */
+/*     $NetBSD: packet.c,v 1.29 2017/10/09 12:07:03 christos Exp $     */
 /* $OpenBSD: packet.c,v 1.264 2017/09/12 06:32:07 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: packet.c,v 1.28 2017/10/07 19:39:19 christos Exp $");
+__RCSID("$NetBSD: packet.c,v 1.29 2017/10/09 12:07:03 christos Exp $");
 
 #include <sys/param.h> /* MIN roundup */
 #include <sys/types.h>
@@ -1779,9 +1779,10 @@
            (r = sshpkt_put_u8(ssh, 0)) != 0 || /* always display */
            (r = sshpkt_put_cstring(ssh, buf)) != 0 ||
            (r = sshpkt_put_cstring(ssh, "")) != 0 ||
-           (r = sshpkt_send(ssh)) != 0 ||
-           (r = ssh_packet_write_wait(ssh)) != 0)
+           (r = sshpkt_send(ssh)) != 0)
                fatal("%s: %s", __func__, ssh_err(r));
+       if ((r = ssh_packet_write_wait(ssh)) < 0)
+               sshpkt_fatal(ssh, __func__, r);
 }
 
 static void



Home | Main Index | Thread Index | Old Index