net-ssh / net-scp

Pure Ruby implementation of the SCP protocol
http://github.com/delano/net-scp
MIT License
154 stars 63 forks source link

SCP servers that do not support quoting #33

Open drieseng opened 7 years ago

drieseng commented 7 years ago

I maintain a .NET SCP library, and I was wondering how you guys deal with SCP servers that do not support quoting paths.

I have users that want to use our library to download or upload files to MikroTik routers, but these routers do not require quoting paths (more below). However, it's not limited to to the MikroTik routers as I was just able to reproduce the problem with the SolarWinds SFTP/SCP Server.

If you'd enclose the path with single or double quotes (I'm over-simplying it here) with these SCP servers, then you end up with files that effectively have file names that are enclosed with these quotes. This also applies to escaping characters using backslashes (eg. escaping a # with a backslash gives you a file that contains the \" characters).

I don't immediately see how a quoting mechanism can be applied that works for both shell and non-shell based SCP servers.

ArtsiomMusin commented 7 years ago

I was going to open a new issue but saw this one. I think we had a similar problem. Take a look at #34. Maybe that change will help you.