upped version to 7.7.1.0 and fixed some issues with session path resolution (#320)

upped version to 7.7.1.0 and fixed some issues with session path resolution
This commit is contained in:
Manoj Ampalam 2018-06-04 21:15:18 -07:00 committed by GitHub
parent 3b450d5072
commit 9369d870ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 16 deletions

View File

@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 7,7,0,0
PRODUCTVERSION 7,7,0,0
FILEVERSION 7,7,1,0
PRODUCTVERSION 7,7,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -67,7 +67,7 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileVersion", "7.7.0.0"
VALUE "FileVersion", "7.7.1.0"
VALUE "ProductName", "OpenSSH for Windows"
VALUE "ProductVersion", "OpenSSH_7.7p1 for Windows"
END

View File

@ -1720,7 +1720,7 @@ cleanup:
char*
build_session_commandline(const char *shell, const char* shell_arg, const char *command, int pty)
{
enum sh_type { SH_CMD, SH_PS, SH_WSL_BASH, SH_CYGWIN, SH_OTHER } shell_type = SH_OTHER;
enum sh_type { SH_OTHER, SH_CMD, SH_PS, SH_BASH } shell_type = SH_OTHER;
enum cmd_type { CMD_OTHER, CMD_SFTP, CMD_SCP } command_type = CMD_OTHER;
char *progdir = w32_programdir(), *cmd_sp = NULL, *cmdline = NULL, *ret = NULL, *p;
int len, progdir_len = (int)strlen(progdir);
@ -1737,10 +1737,8 @@ do { \
shell_type = SH_CMD;
else if (strstr(shell, "powershell"))
shell_type = SH_PS;
else if (strstr(shell, "system32\\bash"))
shell_type = SH_WSL_BASH;
else if (strstr(shell, "cygwin"))
shell_type = SH_CYGWIN;
else if (strstr(shell, "\\bash"))
shell_type = SH_BASH;
/* special case where incoming command needs to be adjusted */
do {
@ -1871,12 +1869,12 @@ do { \
CMDLINE_APPEND(p, " -c ");
/* bash type shells require " decoration around command*/
if (shell_type == SH_WSL_BASH || shell_type == SH_CYGWIN)
if (shell_type == SH_BASH)
CMDLINE_APPEND(p, "\"");
CMDLINE_APPEND(p, command);
if (shell_type == SH_WSL_BASH || shell_type == SH_CYGWIN)
if (shell_type == SH_BASH)
CMDLINE_APPEND(p, "\"");
}
*p = '\0';

View File

@ -95,6 +95,7 @@ set_defaultshell()
goto cleanup;
convertToBackslash(pw_shellpath_local);
to_lower_case(pw_shellpath_local);
pw_shellpath = pw_shellpath_local;
pw_shellpath_local = NULL;
shell_command_option = command_option_local;

View File

@ -359,7 +359,7 @@ test_build_session_commandline()
TEST_DONE();
TEST_START("wsl bash shell tests");
TEST_START("bash shell tests");
out = build_session_commandline("c:\\system32\\bash.exe", NULL, "internal-sftp -arg", 0);
ASSERT_STRING_EQ(out, "\"c:\\system32\\bash.exe\" -c \"sftp-server.exe -arg\"");
free(out);
@ -372,14 +372,11 @@ test_build_session_commandline()
out = build_session_commandline("c:\\system32\\bash", NULL, "scP -arg", 0);
ASSERT_STRING_EQ(out, "\"c:\\system32\\bash\" -c \"scp.exe -arg\"");
free(out);
out = build_session_commandline("c:\\system32\\bash", "-custom", "mycommand -arg", 1);
ASSERT_STRING_EQ(out + shellhost_path_len + 1, "\"c:\\system32\\bash\" -custom \"mycommand -arg\"");
out = build_session_commandline("c:\\bash", "-custom", "mycommand -arg", 1);
ASSERT_STRING_EQ(out + shellhost_path_len + 1, "\"c:\\bash\" -custom \"mycommand -arg\"");
out[shellhost_path_len] = '\0';
ASSERT_STRING_EQ(out, shellhost_path);
free(out);
TEST_DONE();
TEST_START("cygwin bash shell tests");
out = build_session_commandline("c:\\cygwin\\bash.exe", NULL, "internal-sftp -arg", 0);
ASSERT_STRING_EQ(out, "\"c:\\cygwin\\bash.exe\" -c \"sftp-server.exe -arg\"");
free(out);