Executors using SSH fail to run shell detect script
Commit 7bdd7e791cf9c79470bfbd8793760e92f00e5a14 introduced a shell detection script segment as a command argument in the ShellScript
returned by BashShell.GenerateScript()
. When running an executor that uses SSH, ShellScript.GetFullCommand()
is used to get the full shell command line containing this script. The argument should be wrapped in quotes to ensure it's parsed as a single argument as intended, but this function simply concatenates the command and argument strings with a space separating each element, which in turn causes the command to fail to run properly (this doesn't occur with the shell executor, as it uses exec.Command() which handles quoting arguments and such internally). Simply wrapping the command-line elements with quotation marks in ShellScript.GetFullCommand()
resolves this issue.