]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: skip starting the ssh server if user name is lacking
authorDaniel Stenberg <daniel@haxx.se>
Tue, 14 Jun 2022 21:58:26 +0000 (23:58 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 15 Jun 2022 06:31:57 +0000 (08:31 +0200)
Because the ssh server startup script *requires* a user name there's no
point in invoking it if no name was found.

Reported-by: Ricardo M. Correia
Ref: #9007
Closes #9013

tests/runtests.pl

index dcf0f965a110c61bee702b75f3bfdb16e958aa94..97f6e612e13bdf203b1676993e7d2db9cb776c4c 100755 (executable)
@@ -2195,6 +2195,11 @@ sub runsshserver {
     my $logfile;
     my $port = 20000; # no lower port
 
+    if(!$USER) {
+        logmsg "Can't start ssh server due to lack of USER name";
+        return (0,0,0);
+    }
+
     $server = servername_id($proto, $ipvnum, $idnum);
 
     $pidfile = $serverpidfile{$server};