]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: add support for unix domain sockets to ssh -W
authordlg@openbsd.org <dlg@openbsd.org>
Tue, 4 Jul 2023 03:59:21 +0000 (03:59 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Thu, 6 Jul 2023 22:20:25 +0000 (08:20 +1000)
ok djm@ dtucker@

OpenBSD-Commit-ID: 3e6d47567b895c7c28855c7bd614e106c987a6d8

channels.c
channels.h
ssh.c

index f2c873d70ef5a7057f573b7de421717342081850..da66b7b3494c536e1826e8e25724410156239202 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.431 2023/06/05 13:24:36 millert Exp $ */
+/* $OpenBSD: channels.c,v 1.432 2023/07/04 03:59:21 dlg Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1634,7 +1634,7 @@ channel_decode_socks5(Channel *c, struct sshbuf *input, struct sshbuf *output)
 
 Channel *
 channel_connect_stdio_fwd(struct ssh *ssh,
-    const char *host_to_connect, u_short port_to_connect,
+    const char *host_to_connect, int port_to_connect,
     int in, int out, int nonblock)
 {
        Channel *c;
@@ -1651,7 +1651,8 @@ channel_connect_stdio_fwd(struct ssh *ssh,
        c->force_drain = 1;
 
        channel_register_fds(ssh, c, in, out, -1, 0, 1, 0);
-       port_open_helper(ssh, c, "direct-tcpip");
+       port_open_helper(ssh, c, port_to_connect == PORT_STREAMLOCAL ?
+           "direct-streamlocal@openssh.com" : "direct-tcpip");
 
        return c;
 }
index 90f6d29047e4633c180bdcc1b4323e20180cf1b3..7afba78377e00485ad54aa20cc3dc44b59c13371 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.h,v 1.150 2023/06/05 13:24:36 millert Exp $ */
+/* $OpenBSD: channels.h,v 1.151 2023/07/04 03:59:21 dlg Exp $ */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -357,7 +357,7 @@ Channel     *channel_connect_to_port(struct ssh *, const char *, u_short,
            char *, char *, int *, const char **);
 Channel *channel_connect_to_path(struct ssh *, const char *, char *, char *);
 Channel        *channel_connect_stdio_fwd(struct ssh *, const char*,
-           u_short, int, int, int);
+           int, int, int, int);
 Channel        *channel_connect_by_listen_address(struct ssh *, const char *,
            u_short, char *, char *);
 Channel        *channel_connect_by_listen_path(struct ssh *, const char *,
diff --git a/ssh.c b/ssh.c
index 6fc99d88d96fb2d65cfa29d4e7e066fc4fe9d89d..83c509ccf0a40c49d05c8586f0f6d7ee61c39162 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.589 2023/06/21 05:08:32 djm Exp $ */
+/* $OpenBSD: ssh.c,v 1.590 2023/07/04 03:59:21 dlg Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -907,7 +907,9 @@ main(int ac, char **av)
                        if (muxclient_command != 0)
                                fatal("Cannot specify stdio forward with -O");
                        if (parse_forward(&fwd, optarg, 1, 0)) {
-                               options.stdio_forward_host = fwd.listen_host;
+                               options.stdio_forward_host =
+                                   fwd.listen_port == PORT_STREAMLOCAL ?
+                                   fwd.listen_path : fwd.listen_host;
                                options.stdio_forward_port = fwd.listen_port;
                                free(fwd.connect_host);
                        } else {