Skip to content

sshd default shell problem #1206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sunnyqeen opened this issue Jun 30, 2018 · 1 comment
Closed

sshd default shell problem #1206

sunnyqeen opened this issue Jun 30, 2018 · 1 comment

Comments

@sunnyqeen
Copy link

Please answer the following

If it is a terminal issue then please go through wiki
https://github.com/PowerShell/Win32-OpenSSH/wiki/TTY-PTY-support-in-Windows-OpenSSH

"OpenSSH for Windows" version
7.7.1.0

Server OperatingSystem
Windows 10 Pro

Client OperatingSystem
Windows 10 Pro

What is failing
sshd default shell is cmd.exe, and executes command with cmd.exe /c [command]
the problem is the command is not surrounded with "".
if ssh client executes cmd.exe /c cd C:\ && mkdir test

Expected output
rem cmd.exe /c "cd C:\ && mkdir test"
a dir C:\test

Actual output
rem cmd.exe /c cd C:\ && mkdir test
a dir C:\Users\testuser\test

source code
contrib/win32/win32compat/shell-host.c line 1272
command is not surrounded with "".

/*
* Launch via cmd.exe /c, otherwise known issues exist with color rendering in powershell
*/
cmd[0] = L'\0';
GOTO_CLEANUP_ON_ERR(wcscat_s(cmd, MAX_CMD_LEN, system32_path));
GOTO_CLEANUP_ON_ERR(wcscat_s(cmd, MAX_CMD_LEN, L"\\cmd.exe /c "));
GOTO_CLEANUP_ON_ERR(wcscat_s(cmd, MAX_CMD_LEN, command));

SetConsoleCtrlHandler(NULL, FALSE);
GOTO_CLEANUP_ON_FALSE(CreateProcess(NULL, cmd, NULL, NULL, TRUE, CREATE_NEW_CONSOLE,
			NULL, NULL, &si, &pi));
@manojampalam
Copy link
Contributor

Thanks. this will be fixed in next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants