Bugzilla – Attachment 2676 Details for
Bug 2416
[PATCH] Allow forwarding of stdio to streamlocal end points
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
revised revised streamlocal -W patch
openssh-streamlocal2.patch (text/plain), 3.08 KB, created by
Darren Tucker
on 2015-07-17 14:02:24 AEST
(
hide
)
Description:
revised revised streamlocal -W patch
Filename:
MIME Type:
Creator:
Darren Tucker
Created:
2015-07-17 14:02:24 AEST
Size:
3.08 KB
patch
obsolete
>diff --git a/channels.c b/channels.c >index a84b487..623d820 100644 >--- a/channels.c >+++ b/channels.c >@@ -1279,13 +1279,16 @@ channel_decode_socks5(Channel *c, fd_set *readset, fd_set *writeset) > } > > Channel * >-channel_connect_stdio_fwd(const char *host_to_connect, u_short port_to_connect, >+channel_connect_stdio_fwd(const char *host_to_connect, int port_to_connect, > int in, int out) > { > Channel *c; > >- debug("channel_connect_stdio_fwd %s:%d", host_to_connect, >- port_to_connect); >+ if (port_to_connect == PORT_STREAMLOCAL) >+ debug("channel_connect_stdio_fwd stream local %s", host_to_connect); >+ else >+ debug("channel_connect_stdio_fwd %s:%d", host_to_connect, >+ port_to_connect); > > c = channel_new("stdio-forward", SSH_CHANNEL_OPENING, in, out, > -1, CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, >@@ -1297,7 +1300,9 @@ channel_connect_stdio_fwd(const char *host_to_connect, u_short port_to_connect, > c->force_drain = 1; > > channel_register_fds(c, in, out, -1, 0, 1, 0); >- port_open_helper(c, "direct-tcpip"); >+ port_open_helper(c, ((port_to_connect == PORT_STREAMLOCAL) >+ ? "direct-streamlocal@openssh.com" >+ : "direct-tcpip")); > > return c; > } >diff --git a/channels.h b/channels.h >index 9d76c9d..90ddaeb 100644 >--- a/channels.h >+++ b/channels.h >@@ -270,7 +270,7 @@ void channel_print_adm_permitted_opens(void); > int channel_input_port_forward_request(int, struct ForwardOptions *); > Channel *channel_connect_to_port(const char *, u_short, char *, char *); > Channel *channel_connect_to_path(const char *, char *, char *); >-Channel *channel_connect_stdio_fwd(const char*, u_short, int, int); >+Channel *channel_connect_stdio_fwd(const char*, int, int, int); > Channel *channel_connect_by_listen_address(const char *, u_short, > char *, char *); > Channel *channel_connect_by_listen_path(const char *, char *, char *); >diff --git a/ssh.c b/ssh.c >index 3fd5a94..37df417 100644 >--- a/ssh.c >+++ b/ssh.c >@@ -151,7 +151,7 @@ int ostdin_null_flag, ono_shell_flag, otty_flag, orequest_tty; > */ > int fork_after_authentication_flag = 0; > >-/* forward stdio to remote host and port */ >+/* forward stdio to remote host and port or unix socket */ > char *stdio_forward_host = NULL; > int stdio_forward_port = 0; > >@@ -761,7 +761,9 @@ main(int ac, char **av) > if (muxclient_command != 0) > fatal("Cannot specify stdio forward with -O"); > if (parse_forward(&fwd, optarg, 1, 0)) { >- stdio_forward_host = fwd.listen_host; >+ stdio_forward_host = >+ ((fwd.listen_port == PORT_STREAMLOCAL) ? >+ fwd.listen_path : fwd.listen_host); > stdio_forward_port = fwd.listen_port; > free(fwd.connect_host); > } else { >@@ -1498,7 +1500,11 @@ ssh_init_stdio_forwarding(void) > if (!compat20) > fatal("stdio forwarding require Protocol 2"); > >- debug3("%s: %s:%d", __func__, stdio_forward_host, stdio_forward_port); >+ if (stdio_forward_port == PORT_STREAMLOCAL) >+ debug3("%s: stream local %s", __func__, stdio_forward_host); >+ else >+ debug3("%s: %s:%d", __func__, stdio_forward_host, >+ stdio_forward_port); > > if ((in = dup(STDIN_FILENO)) < 0 || > (out = dup(STDOUT_FILENO)) < 0)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2416
:
2654
|
2675
| 2676