From 72df8fad29a27052e43ffcd0cfd00810d59d85aa Mon Sep 17 00:00:00 2001 From: olegkap_cp Date: Mon, 18 Jun 2012 13:21:54 +0000 Subject: [PATCH] Enclode filename in quotes for SCP operation as recomended --- Renci.SshClient/Renci.SshNet/ScpClient.NET.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Renci.SshClient/Renci.SshNet/ScpClient.NET.cs b/Renci.SshClient/Renci.SshNet/ScpClient.NET.cs index 2b2b7815..47d39450 100644 --- a/Renci.SshClient/Renci.SshNet/ScpClient.NET.cs +++ b/Renci.SshClient/Renci.SshNet/ScpClient.NET.cs @@ -45,7 +45,8 @@ namespace Renci.SshNet channel.Open(); // Send channel command request - channel.SendExecRequest(string.Format("scp -qt {0}", filename)); + channel.SendExecRequest(string.Format("scp -qt \"{0}\"", filename)); + this.CheckReturnCode(input); this.InternalUpload(channel, input, fileInfo, filename); @@ -82,7 +83,7 @@ namespace Renci.SshNet channel.Open(); // Send channel command request - channel.SendExecRequest(string.Format("scp -qrt {0}", filename)); + channel.SendExecRequest(string.Format("scp -qrt \"{0}\"", filename)); this.CheckReturnCode(input); this.InternalUpload(channel, input, directoryInfo, filename); @@ -156,7 +157,7 @@ namespace Renci.SshNet channel.Open(); // Send channel command request - channel.SendExecRequest(string.Format("scp -qprf {0}", directoryName)); + channel.SendExecRequest(string.Format("scp -qprf \"{0}\"", directoryName)); this.SendConfirmation(channel); // Send reply this.InternalDownload(channel, input, directoryInfo);