From cb3894f1bc9e529e00dc1f8f9f0fd676fd32bead Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sat, 22 Mar 2014 05:35:35 +0000 Subject: [PATCH] Try to automatically pipe a "y" to plink.exe, to auto accept unknown host keys. See http://www.heidisql.com/forum.php?t=15224 --- source/dbconnection.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/dbconnection.pas b/source/dbconnection.pas index 01d199f1..d84bd7c0 100644 --- a/source/dbconnection.pas +++ b/source/dbconnection.pas @@ -1106,7 +1106,7 @@ begin ntMySQL_SSHtunnel: begin // Build plink.exe command line // plink bob@domain.com -pw myPassw0rd1 -P 22 -i "keyfile.pem" -L 55555:localhost:3306 - PlinkCmd := '"'+FParameters.SSHPlinkExe + '" -ssh '; + PlinkCmd := '/C echo y | "'+FParameters.SSHPlinkExe + '" -ssh '; if FParameters.SSHUser <> '' then PlinkCmd := PlinkCmd + FParameters.SSHUser + '@'; if FParameters.SSHHost <> '' then @@ -1129,7 +1129,7 @@ begin FillChar(FPlinkProcInfo, SizeOf(TProcessInformation), 0); FillChar(StartupInfo, SizeOf(TStartupInfo), 0); StartupInfo.cb := SizeOf(TStartupInfo); - if CreateProcess(nil, PChar(PlinkCmd), nil, nil, false, + if CreateProcess(PChar('C:\Windows\System32\cmd.exe'), PChar(PlinkCmd), nil, nil, false, CREATE_DEFAULT_ERROR_MODE + NORMAL_PRIORITY_CLASS + CREATE_NO_WINDOW, nil, nil, StartupInfo, FPlinkProcInfo) then begin WaitForSingleObject(FPlinkProcInfo.hProcess, FParameters.SSHTimeout*1000);