|
Lines 131-136
int stdin_null_flag = 0;
Link Here
|
| 131 |
*/ |
131 |
*/ |
| 132 |
int fork_after_authentication_flag = 0; |
132 |
int fork_after_authentication_flag = 0; |
| 133 |
|
133 |
|
|
|
134 |
/* forward stdio to remote host and port */ |
| 135 |
char *stdio_forward_host = NULL; |
| 136 |
int stdio_forward_port = 0; |
| 137 |
|
| 134 |
/* |
138 |
/* |
| 135 |
* General data structure for command line options and options configurable |
139 |
* General data structure for command line options and options configurable |
| 136 |
* in configuration files. See readconf.h. |
140 |
* in configuration files. See readconf.h. |
|
Lines 274-280
main(int ac, char **av)
Link Here
|
| 274 |
|
278 |
|
| 275 |
again: |
279 |
again: |
| 276 |
while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx" |
280 |
while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx" |
| 277 |
"ACD:F:I:KL:MNO:PR:S:TVw:XYy")) != -1) { |
281 |
"ACD:F:I:KL:MNO:PR:S:TVw:W:XYy")) != -1) { |
| 278 |
switch (opt) { |
282 |
switch (opt) { |
| 279 |
case '1': |
283 |
case '1': |
| 280 |
options.protocol = SSH_PROTO_1; |
284 |
options.protocol = SSH_PROTO_1; |
|
Lines 387-392
main(int ac, char **av)
Link Here
|
| 387 |
exit(255); |
391 |
exit(255); |
| 388 |
} |
392 |
} |
| 389 |
break; |
393 |
break; |
|
|
394 |
case 'W': |
| 395 |
if (parse_forward(&fwd, optarg, 1, 0)) { |
| 396 |
stdio_forward_host = fwd.listen_host; |
| 397 |
stdio_forward_port = fwd.listen_port; |
| 398 |
xfree(fwd.connect_host); |
| 399 |
} else { |
| 400 |
fprintf(stderr, |
| 401 |
"Bad stdio forwarding specification '%s'\n", |
| 402 |
optarg); |
| 403 |
exit(255); |
| 404 |
} |
| 405 |
no_tty_flag = 1; |
| 406 |
no_shell_flag = 1; |
| 407 |
options.clear_forwardings = 1; |
| 408 |
options.exit_on_forward_failure = 1; |
| 409 |
break; |
| 390 |
case 'q': |
410 |
case 'q': |
| 391 |
options.log_level = SYSLOG_LEVEL_QUIET; |
411 |
options.log_level = SYSLOG_LEVEL_QUIET; |
| 392 |
break; |
412 |
break; |
|
Lines 868-878
ssh_confirm_remote_forward(int type, u_i
Link Here
|
| 868 |
} |
888 |
} |
| 869 |
|
889 |
|
| 870 |
static void |
890 |
static void |
|
|
891 |
client_cleanup_stdio_fwd(int id, void *arg) |
| 892 |
{ |
| 893 |
debug("stdio forwarding: done"); |
| 894 |
cleanup_exit(0); |
| 895 |
} |
| 896 |
|
| 897 |
static int |
| 898 |
client_setup_stdio_fwd(const char *host_to_connect, u_short port_to_connect) |
| 899 |
{ |
| 900 |
Channel *c; |
| 901 |
|
| 902 |
debug3("client_setup_stdio_fwd %s:%d", host_to_connect, port_to_connect); |
| 903 |
if ((c = channel_connect_stdio_fwd(host_to_connect, port_to_connect)) == NULL) |
| 904 |
return 0; |
| 905 |
channel_register_cleanup(c->self, client_cleanup_stdio_fwd, 0); |
| 906 |
return 1; |
| 907 |
} |
| 908 |
|
| 909 |
static void |
| 871 |
ssh_init_forwarding(void) |
910 |
ssh_init_forwarding(void) |
| 872 |
{ |
911 |
{ |
| 873 |
int success = 0; |
912 |
int success = 0; |
| 874 |
int i; |
913 |
int i; |
| 875 |
|
914 |
|
|
|
915 |
if (stdio_forward_host != NULL) { |
| 916 |
if (!client_setup_stdio_fwd(stdio_forward_host, |
| 917 |
stdio_forward_port)) |
| 918 |
fatal("Failed to connect in stdio forward mode."); |
| 919 |
} |
| 920 |
|
| 876 |
/* Initiate local TCP/IP port forwardings. */ |
921 |
/* Initiate local TCP/IP port forwardings. */ |
| 877 |
for (i = 0; i < options.num_local_forwards; i++) { |
922 |
for (i = 0; i < options.num_local_forwards; i++) { |
| 878 |
debug("Local connections to %.200s:%d forwarded to remote " |
923 |
debug("Local connections to %.200s:%d forwarded to remote " |