Add tests for run ssh_execute_command

Signed-off-by: Ran Park <bagayonghuming@gmail.com>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Ran Park
2023-04-17 19:57:51 +08:00
committed by Jakub Jelen
parent 9cd23fecac
commit d109b5bd5f
3 changed files with 53 additions and 11 deletions

View File

@@ -923,8 +923,8 @@ ssh_execute_command(const char *command, socket_t in, socket_t out)
*/
shell = getenv("SHELL");
if (shell == NULL || shell[0] == '\0') {
/* Fall back to bash. There are issues with dash or
* whatever people tend to link to /bin/sh */
/* Fall back to the /bin/sh only if the bash is not available. But there are
* issues with dash or whatever people tend to link to /bin/sh */
rc = access("/bin/bash", 0);
if (rc != 0) {
shell = "/bin/sh";