From b70e21801e208df2d3f4f03662c2e7a20dd3f31e Mon Sep 17 00:00:00 2001 From: Gert Driesen Date: Sun, 27 Aug 2017 08:59:26 +0200 Subject: [PATCH 1/2] Pass full remote file path to scp command when uploading or downloading a file, and use zero-length pass in C directive. Combined, this ensure the SCP server will reject a remote file path that points to a directory. Fixes issue #286. --- .../Renci.SshNet.NET35.csproj | 5 +- ...InfoAndPath_SendExecRequestReturnsFalse.cs | 2 +- ...ientTest_Upload_FileInfoAndPath_Success.cs | 8 +- src/Renci.SshNet/Common/PosixPath.cs | 24 ++++ src/Renci.SshNet/Renci.SshNet.csproj | 1 + src/Renci.SshNet/ScpClient.NET.cs | 94 +++++++-------- src/Renci.SshNet/ScpClient.cs | 107 ++++++++++++------ 7 files changed, 150 insertions(+), 91 deletions(-) create mode 100644 src/Renci.SshNet/Common/PosixPath.cs diff --git a/src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj b/src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj index 4c0c06abc..ed44fb520 100644 --- a/src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj +++ b/src/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj @@ -197,6 +197,9 @@ Common\PortForwardEventArgs.cs + + Common\PosixPath.cs + Common\ProxyException.cs @@ -953,7 +956,7 @@ - +