View | Details | Raw Unified | Return to bug 2416 | Differences between
and this patch

Collapse All | Expand All

(-)a/channels.c (-4 / +9 lines)
Lines 1279-1291 channel_decode_socks5(Channel *c, fd_set *readset, fd_set *writeset) Link Here
1279
}
1279
}
1280
1280
1281
Channel *
1281
Channel *
1282
channel_connect_stdio_fwd(const char *host_to_connect, u_short port_to_connect,
1282
channel_connect_stdio_fwd(const char *host_to_connect, int port_to_connect,
1283
    int in, int out)
1283
    int in, int out)
1284
{
1284
{
1285
	Channel *c;
1285
	Channel *c;
1286
1286
1287
	debug("channel_connect_stdio_fwd %s:%d", host_to_connect,
1287
	if (port_to_connect == PORT_STREAMLOCAL)
1288
	    port_to_connect);
1288
		debug("channel_connect_stdio_fwd stream local %s", host_to_connect);
1289
	else
1290
		debug("channel_connect_stdio_fwd %s:%d", host_to_connect,
1291
		    port_to_connect);
1289
1292
1290
	c = channel_new("stdio-forward", SSH_CHANNEL_OPENING, in, out,
1293
	c = channel_new("stdio-forward", SSH_CHANNEL_OPENING, in, out,
1291
	    -1, CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT,
1294
	    -1, CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT,
Lines 1297-1303 channel_connect_stdio_fwd(const char *host_to_connect, u_short port_to_connect, Link Here
1297
	c->force_drain = 1;
1300
	c->force_drain = 1;
1298
1301
1299
	channel_register_fds(c, in, out, -1, 0, 1, 0);
1302
	channel_register_fds(c, in, out, -1, 0, 1, 0);
1300
	port_open_helper(c, "direct-tcpip");
1303
	port_open_helper(c, ((port_to_connect == PORT_STREAMLOCAL)
1304
			     ? "direct-streamlocal@openssh.com"
1305
			     : "direct-tcpip"));
1301
1306
1302
	return c;
1307
	return c;
1303
}
1308
}
(-)a/channels.h (-1 / +1 lines)
Lines 270-276 void channel_print_adm_permitted_opens(void); Link Here
270
int      channel_input_port_forward_request(int, struct ForwardOptions *);
270
int      channel_input_port_forward_request(int, struct ForwardOptions *);
271
Channel	*channel_connect_to_port(const char *, u_short, char *, char *);
271
Channel	*channel_connect_to_port(const char *, u_short, char *, char *);
272
Channel *channel_connect_to_path(const char *, char *, char *);
272
Channel *channel_connect_to_path(const char *, char *, char *);
273
Channel	*channel_connect_stdio_fwd(const char*, u_short, int, int);
273
Channel	*channel_connect_stdio_fwd(const char*, int, int, int);
274
Channel	*channel_connect_by_listen_address(const char *, u_short,
274
Channel	*channel_connect_by_listen_address(const char *, u_short,
275
	     char *, char *);
275
	     char *, char *);
276
Channel	*channel_connect_by_listen_path(const char *, char *, char *);
276
Channel	*channel_connect_by_listen_path(const char *, char *, char *);
(-)a/ssh.c (-3 / +9 lines)
Lines 151-157 int ostdin_null_flag, ono_shell_flag, otty_flag, orequest_tty; Link Here
151
 */
151
 */
152
int fork_after_authentication_flag = 0;
152
int fork_after_authentication_flag = 0;
153
153
154
/* forward stdio to remote host and port */
154
/* forward stdio to remote host and port or unix socket */
155
char *stdio_forward_host = NULL;
155
char *stdio_forward_host = NULL;
156
int stdio_forward_port = 0;
156
int stdio_forward_port = 0;
157
157
Lines 761-767 main(int ac, char **av) Link Here
761
			if (muxclient_command != 0)
761
			if (muxclient_command != 0)
762
				fatal("Cannot specify stdio forward with -O");
762
				fatal("Cannot specify stdio forward with -O");
763
			if (parse_forward(&fwd, optarg, 1, 0)) {
763
			if (parse_forward(&fwd, optarg, 1, 0)) {
764
				stdio_forward_host = fwd.listen_host;
764
				stdio_forward_host =
765
				    ((fwd.listen_port == PORT_STREAMLOCAL) ?
766
				    fwd.listen_path : fwd.listen_host);
765
				stdio_forward_port = fwd.listen_port;
767
				stdio_forward_port = fwd.listen_port;
766
				free(fwd.connect_host);
768
				free(fwd.connect_host);
767
			} else {
769
			} else {
Lines 1498-1504 ssh_init_stdio_forwarding(void) Link Here
1498
	if (!compat20)
1500
	if (!compat20)
1499
		fatal("stdio forwarding require Protocol 2");
1501
		fatal("stdio forwarding require Protocol 2");
1500
1502
1501
	debug3("%s: %s:%d", __func__, stdio_forward_host, stdio_forward_port);
1503
	if (stdio_forward_port == PORT_STREAMLOCAL)
1504
		debug3("%s: stream local %s", __func__, stdio_forward_host);
1505
	else
1506
		debug3("%s: %s:%d", __func__, stdio_forward_host,
1507
		    stdio_forward_port);
1502
1508
1503
	if ((in = dup(STDIN_FILENO)) < 0 ||
1509
	if ((in = dup(STDIN_FILENO)) < 0 ||
1504
	    (out = dup(STDOUT_FILENO)) < 0)
1510
	    (out = dup(STDOUT_FILENO)) < 0)

Return to bug 2416