]> xenbits.xensource.com Git - people/aperard/osstest.git/commitdiff
tcmd: Work around ssh bug with `ssh host ""'
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 17 May 2017 20:58:09 +0000 (21:58 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 17 May 2017 22:52:03 +0000 (23:52 +0100)
This runs an interactive shell session on the host, rathern than
running `sh -c ""' on it.

Evidently ssh checks for the presence of a command line specification
after (foolishly, but now historically unavoidably) concatenating all
the command line arguments with spaces in between.

Turn  ssh host ""  into  ssh host " "  which is the expected no-op.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Osstest/TestSupport.pm

index 19bdd23177992d2c210d7b228fdcbd45f30906b6..b947a0caee3f42ba1952e36a4d08eb29dac680c8 100644 (file)
@@ -676,6 +676,7 @@ sub tcmd { # $tcmd will be put between '' but not escaped
     my ($stdin,$stdout,$user,$ho,$tcmd,$timeout,$extrasshopts) = @_;
     $timeout=30 if !defined $timeout;
     target_adjust_timeout($ho,\$timeout);
+    $tcmd = ' ' if $tcmd eq ''; # ssh host '' logs in !
     tcmdex($timeout,$stdin,$stdout,
            'ssh', sshopts(), @{ $extrasshopts || [] },
            sshuho($user,$ho), $tcmd);