ArxOne / FTP

Simple FTP client
MIT License
37 stars 15 forks source link

Unix space quoting issues #55

Closed angelolocritani closed 1 year ago

angelolocritani commented 1 year ago

The quoting of spaces seems incosistent: on MKD spaces are not quoted but on STAT they're quoted

on out server, this command return ok "MKD /ConadSicilia/3P/PV1595 - ITA" so the directory is created without problem; but checking if directory exists, using GetEntry, returns an error. I found that is because STAT is called with quoted spaces: "STAT /ConadSicilia/3P/PV1595\\ -\\ ITA"

In my case, FtpPlatform GetFtpPlatform(FtpServerType serverType, string system) is called with serverType Unix, and system "UNIX Type: L8" so the UnixFtpPlatform.EscapePath is then called. That function indicates that space has to be quoted; I found that the decision to quote space has been changed back and forth in April 2016 (0cb32a8a4a7f6492a698f6c20c13465fefb03e8a and 48563cb3df4bc604787b60a4b95e538616b2f086)

Just for my server I edited to exclude space from quoting and it solved the issue but I found no definitive information about which behavior is correct or if is it implementation dependent, so I'm reluctant to submit a PR to remove space character from quoting.

picrap commented 1 year ago

The best option would probably to change the way your server is identified, thus avoid quoting spaces?

angelolocritani commented 1 year ago

The best option would probably to change the way your server is identified, thus avoid quoting spaces?

Yes, probably; by the way we are using ProFTPD Version 1.3.6e (SYST response => UNIX type L8), maybe I could derive an ad-hoc FTP Platform for that.

Still, I found no quoting is applied when using MKD command but quoting is applied when using STAT, so at least some inconsistency is there, regardless of our specific server.

picrap commented 1 year ago

I had really hard times setting up configurations for all FTP servers I could find, so currently it works with all of them (and of course, I didn’t write a list of them), but since FTP is a blurry standard 😄 we need special cases for each server, escaping this, not escaping that, etc. I don’t work on it anymore, but I still accept pull requests 😉

angelolocritani commented 1 year ago

With PR merged, I think this issue could be closed