Fix ssh client not executing shell cmd given as argument

"ssh user@host whoami" now works and will show the whoami command
output. sshd server was fine but ssh client was not working.
This commit is contained in:
quamrulmina 2015-10-28 18:11:52 -05:00
parent 3c6c8c3ca5
commit 889e58c056
2 changed files with 5 additions and 1 deletions

View File

@ -877,7 +877,7 @@ do_exec_no_pty(Session *s, const char *command)
GetUserName(name, &size);
if (!(s -> is_subsystem)) {
if ( (!s -> is_subsystem) && (s ->ttyfd != -1)) {
// Send to the remote client ANSI/VT Sequence so that they send us CRLF in place of LF
char *inittermseq = "\033[20h\033[?7h\0" ; // LFtoCRLF AUTOWRAPON
Channel *c=channel_by_id ( s->chanid );

4
ssh.c
View File

@ -1534,6 +1534,10 @@ main(int ac, char **av)
HANDLE hInput = GetStdHandle(STD_INPUT_HANDLE);
ConInit( STD_OUTPUT_HANDLE, TRUE ); //init the output console surface for us to write
}
else {
extern int glob_itissshclient;
glob_itissshclient = 1; // tell our contrib/win32/win32compat/socket.c code it is for ssh client side
}
#endif
exit_status = compat20 ? ssh_session2() : ssh_session();