GNOME Bugzilla – Bug 745520
Should send CLNT before OPTS
Last modified: 2018-09-21 17:45:55 UTC
gvfs has troubles enabling the UTF-8 mode with "Gene6" FTP server, which requires that CLNT be sent first. While CLNT seems to be widely implemented, I can't find any specification; the parameter seems to be an arbitrary version string just like a HTTP User-Agent. Log of problematic connection: - 220 Gene6 FTP Server v3.10.0 (Build 2) ready... FEAT - 211-Extensions supported: - AUTH TLS - CCC - CLNT - CPSV - EPRT - EPSV - MDTM - MFCT - MFMT - MLST type*;size*;create;modify*; - MODE Z - PASV - PBSZ - PROT - REST STREAM - SIZE - SSCN - TVFS - UTF8 - XCRC "filename" SP EP - XMD5 "filename" SP EP - XSHA1 "filename" SP EP - 211 End. USER mantas - 331 Password required for mantas. PASS <Foo.> - 230 User mantas logged in. TYPE I - 200 Type set to I. OPTS UTF8 ON - 501 Please CLNT first. SYST - 215 UNIX Type: L8 SITE HELP - 214 No help available PWD - 257 "/" is current directory. (Similar report to FileZilla client: <https://forum.filezilla-project.org/viewtopic.php?t=889>)
Created attachment 298419 [details] [review] patch: send CLNT before OPTS
+ if (!g_vfs_ftp_task_send (task, 0, "CLNT gvfs/" VERSION)) Is it really necessary to leak the exact client version to the server, instead of just sending something generic like "gvfs/1.0" ?
(In reply to Christian Persch from comment #2) > + if (!g_vfs_ftp_task_send (task, 0, "CLNT gvfs/" VERSION)) > > Is it really necessary to leak the exact client version to the server, > instead of just sending something generic like "gvfs/1.0" ? That's what the http backend currently does. Neither the FTP server nor myself care much about what is being sent though.
A quick google online suggests that some users have reported issues that using CLNT breaks some transparent ftp proxies. I need to do more investigation to see whether this is safe or not.
As an alternative, the server also supports MLSD [1] for structured file lists, and /seems/ to always use UTF-8 with it. (Might be easier for gvfs to parse than LIST, too.) But from the posts I found, proxies seem to be even worse regarding MLSD :( [1]: https://tools.ietf.org/html/rfc3659#section-7
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/244.