]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: close the shell used to start sshd
authorDan Fandrich <dan@coneharvesters.com>
Wed, 4 Oct 2023 22:14:05 +0000 (15:14 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Wed, 4 Oct 2023 22:20:45 +0000 (15:20 -0700)
This shell isn't needed once sshd starts, so use "exec" so it doesn't
stick around.

Closes #12032

tests/sshserver.pl

index 2a69561892d40cfc34210fc9809d2331fd6806fd..cba8a88ef0424a780c603ace226d1abf724a571d 100755 (executable)
@@ -1175,7 +1175,8 @@ if ($sshdid =~ /OpenSSH-Windows/) {
 #***************************************************************************
 # Start the ssh server daemon without forking it
 #
-my $rc = system($cmd);
+# "exec" avoids the shell process sticking around
+my $rc = system("exec " . $cmd);
 if($rc == -1) {
     logmsg "\"$sshd\" failed with: $!\n";
 }