Ported upstream changes to Windows fork

This commit is contained in:
Manoj Ampalam 2017-10-03 14:37:25 -07:00
parent 6fba3a2ae9
commit 97565d8b4f
1 changed files with 7 additions and 7 deletions

View File

@ -405,7 +405,7 @@ static void setup_session_vars(Session* s) {
char* w32_programdir(); char* w32_programdir();
int register_child(void* child, unsigned long pid); int register_child(void* child, unsigned long pid);
int do_exec_windows(Session *s, const char *command, int pty) { int do_exec_windows(struct ssh *ssh, Session *s, const char *command, int pty) {
int pipein[2], pipeout[2], pipeerr[2], r; int pipein[2], pipeout[2], pipeerr[2], r;
char *exec_command = NULL, *progdir = w32_programdir(), *cmd = NULL, *shell_host = NULL, *command_b64 = NULL; char *exec_command = NULL, *progdir = w32_programdir(), *cmd = NULL, *shell_host = NULL, *command_b64 = NULL;
wchar_t *exec_command_w = NULL, *pw_dir_w; wchar_t *exec_command_w = NULL, *pw_dir_w;
@ -582,9 +582,9 @@ int do_exec_windows(Session *s, const char *command, int pty) {
* handle the case that fdin and fdout are the same. * handle the case that fdin and fdout are the same.
*/ */
if (s->ttyfd == -1) if (s->ttyfd == -1)
session_set_fds(s, pipein[1], pipeout[0], pipeerr[0], s->is_subsystem, 0); session_set_fds(ssh, s, pipein[1], pipeout[0], pipeerr[0], s->is_subsystem, 0);
else else
session_set_fds(s, pipein[1], pipeout[0], pipeerr[0], s->is_subsystem, 1); /* tty interactive session */ session_set_fds(ssh, s, pipein[1], pipeout[0], pipeerr[0], s->is_subsystem, 1); /* tty interactive session */
free(pw_dir_w); free(pw_dir_w);
free(exec_command_w); free(exec_command_w);
@ -592,13 +592,13 @@ int do_exec_windows(Session *s, const char *command, int pty) {
} }
int int
do_exec_no_pty(Session *s, const char *command) { do_exec_no_pty(struct ssh *ssh, Session *s, const char *command) {
return do_exec_windows(s, command, 0); return do_exec_windows(ssh, s, command, 0);
} }
int int
do_exec_pty(Session *s, const char *command) { do_exec_pty(struct ssh *ssh, Session *s, const char *command) {
return do_exec_windows(s, command, 1); return do_exec_windows(ssh, s, command, 1);
} }
#else /* !WINDOWS */ #else /* !WINDOWS */