version 1.446, 2016/09/12 23:31:27 |
version 1.447, 2016/09/30 09:19:13 |
|
|
static void load_public_identity_files(void); |
static void load_public_identity_files(void); |
static void main_sigchld_handler(int); |
static void main_sigchld_handler(int); |
|
|
/* from muxclient.c */ |
|
void muxclient(const char *); |
|
void muxserver_listen(void); |
|
|
|
/* ~/ expand a list of paths. NB. assumes path[n] is heap-allocated. */ |
/* ~/ expand a list of paths. NB. assumes path[n] is heap-allocated. */ |
static void |
static void |
tilde_expand_paths(char **paths, u_int num_paths) |
tilde_expand_paths(char **paths, u_int num_paths) |
|
|
muxclient_command = SSHMUX_COMMAND_STOP; |
muxclient_command = SSHMUX_COMMAND_STOP; |
else if (strcmp(optarg, "cancel") == 0) |
else if (strcmp(optarg, "cancel") == 0) |
muxclient_command = SSHMUX_COMMAND_CANCEL_FWD; |
muxclient_command = SSHMUX_COMMAND_CANCEL_FWD; |
|
else if (strcmp(optarg, "proxy") == 0) |
|
muxclient_command = SSHMUX_COMMAND_PROXY; |
else |
else |
fatal("Invalid multiplex command."); |
fatal("Invalid multiplex command."); |
break; |
break; |
|
|
tty_flag = options.request_tty != REQUEST_TTY_NO; |
tty_flag = options.request_tty != REQUEST_TTY_NO; |
|
|
/* Force no tty */ |
/* Force no tty */ |
if (options.request_tty == REQUEST_TTY_NO || muxclient_command != 0) |
if (options.request_tty == REQUEST_TTY_NO || |
|
(muxclient_command && muxclient_command != SSHMUX_COMMAND_PROXY)) |
tty_flag = 0; |
tty_flag = 0; |
/* Do not allocate a tty if stdin is not a tty. */ |
/* Do not allocate a tty if stdin is not a tty. */ |
if ((!isatty(fileno(stdin)) || stdin_null_flag) && |
if ((!isatty(fileno(stdin)) || stdin_null_flag) && |
|
|
|
|
if (muxclient_command != 0 && options.control_path == NULL) |
if (muxclient_command != 0 && options.control_path == NULL) |
fatal("No ControlPath specified for \"-O\" command"); |
fatal("No ControlPath specified for \"-O\" command"); |
if (options.control_path != NULL) |
if (options.control_path != NULL) { |
muxclient(options.control_path); |
int sock; |
|
if ((sock = muxclient(options.control_path)) >= 0) { |
|
packet_set_connection(sock, sock); |
|
ssh = active_state; /* XXX */ |
|
enable_compat20(); /* XXX */ |
|
packet_set_mux(); |
|
goto skip_connect; |
|
} |
|
} |
|
|
/* |
/* |
* If hostname canonicalisation was not enabled, then we may not |
* If hostname canonicalisation was not enabled, then we may not |
|
|
options.certificate_files[i] = NULL; |
options.certificate_files[i] = NULL; |
} |
} |
|
|
|
skip_connect: |
exit_status = compat20 ? ssh_session2() : ssh_session(); |
exit_status = compat20 ? ssh_session2() : ssh_session(); |
packet_close(); |
packet_close(); |
|
|
|
|
ssh_init_forwarding(); |
ssh_init_forwarding(); |
|
|
/* Start listening for multiplex clients */ |
/* Start listening for multiplex clients */ |
muxserver_listen(); |
if (!packet_get_mux()) |
|
muxserver_listen(); |
|
|
/* |
/* |
* If we are in control persist mode and have a working mux listen |
* If we are in control persist mode and have a working mux listen |