After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 745520 - Should send CLNT before OPTS
Should send CLNT before OPTS
Status: RESOLVED OBSOLETE
Product: gvfs
Classification: Core
Component: ftp backend
git master
Other Linux
: Normal normal
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2015-03-03 12:12 UTC by Mantas Mikulėnas (grawity)
Modified: 2018-09-21 17:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch: send CLNT before OPTS (2.10 KB, patch)
2015-03-03 12:27 UTC, Mantas Mikulėnas (grawity)
none Details | Review

Description Mantas Mikulėnas (grawity) 2015-03-03 12:12:34 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>)
Comment 1 Mantas Mikulėnas (grawity) 2015-03-03 12:27:32 UTC
Created attachment 298419 [details] [review]
patch: send CLNT before OPTS
Comment 2 Christian Persch 2015-03-03 17:42:12 UTC
+     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" ?
Comment 3 Mantas Mikulėnas (grawity) 2015-03-03 17:47:35 UTC
(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.
Comment 4 Ross Lagerwall 2015-03-04 00:11:27 UTC
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.
Comment 5 Mantas Mikulėnas (grawity) 2015-03-04 05:56:52 UTC
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
Comment 6 GNOME Infrastructure Team 2018-09-21 17:45:55 UTC
-- 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.