Skip to content
Permalink
Browse files

Escape double quotes in SSH password for plink command. Closes issue #…

  • Loading branch information...
ansgarbecker committed Jun 29, 2019
1 parent f2ed7b0 commit 92a34000e35e19cb654157f846010bd148ca5397
Showing with 4 additions and 2 deletions.
  1. +4 −2 source/dbconnection.pas
@@ -838,8 +838,10 @@ procedure TPlink.Connect;
PlinkCmd := PlinkCmd + FConnection.Parameters.SSHHost
else
PlinkCmd := PlinkCmd + FConnection.Parameters.Hostname;
if FConnection.Parameters.SSHPassword <> '' then
PlinkCmd := PlinkCmd + ' -pw "' + FConnection.Parameters.SSHPassword + '"';
if FConnection.Parameters.SSHPassword <> '' then begin
// Escape double quote with backslash, see issue #261
PlinkCmd := PlinkCmd + ' -pw "' + StringReplace(FConnection.Parameters.SSHPassword, '"', '\"', [rfReplaceAll]) + '"';
end;
if FConnection.Parameters.SSHPort > 0 then
PlinkCmd := PlinkCmd + ' -P ' + IntToStr(FConnection.Parameters.SSHPort);
if FConnection.Parameters.SSHPrivateKey <> '' then

0 comments on commit 92a3400

Please sign in to comment.
You can’t perform that action at this time.