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 643608 - Connecting to FTP server & ftp server begins with ftp://
Connecting to FTP server & ftp server begins with ftp://
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Navigation
2.91.x
Other Linux
: Normal normal
: 3.0
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-01 17:38 UTC by Izidor Matušov
Modified: 2011-05-23 15:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
preliminary patch (1.01 KB, patch)
2011-03-07 11:03 UTC, Stefano Teso
committed Details | Review

Description Izidor Matušov 2011-03-01 17:38:21 UTC
Hi everybody,

I wasn't a quite sure which product/component  is the right, feel free to change it.

How to reproduce the bug:

1, Select Places (system menu) -> Connect to server
2, Connection type: FTP (with login)
3, Put in Sever field: ftp://example.com
4, Fill username
5, Press connect

Actual result:
Waiting until a timeout and a error message.

Expected result:
Connecting to the server without problem.
Comment 1 André Klapper 2011-03-03 19:29:24 UTC
Hmm, why is this a bug in GNOME? If the server is done or not accessible through your network, there's nothing that can be done.
Comment 2 Izidor Matušov 2011-03-03 20:01:42 UTC
The server is accessible (when I correctly enter address or use other FTP tool), but the utility is not able to handle the format.

The problem is prefix ftp:// which cannot be handled correctly. I.e. example.com works perfect, ftp://example.com doesn't.
Comment 3 Stefano Teso 2011-03-07 11:03:36 UTC
Created attachment 182688 [details] [review]
preliminary patch

It seems a fair request to me, and the fix looks trivial. The attached preliminary patch strips the scheme from the server URI _if_ it matches the chosen method's scheme. The problem is what to do if the method's scheme (e.g., ftp) doesn't match the server's scheme (e.g., ssh)... Comments are welcome.
Comment 4 Stefano Teso 2011-03-08 08:52:04 UTC
I gave this a bit more thought. I think a nice solution would be:

- when the combo box changes, the uri scheme of the server string (if any) is updated accordingly
- when the uri scheme of the server string changes, the combo box is updated accordingly

That requires a bit more code, but should be feasible. I'll wait for feedback from the maintainers and usability people before digging into it myself, though.
Comment 5 Cosimo Cecchi 2011-04-04 00:34:45 UTC
Review of attachment 182688 [details] [review]:

Thanks for the patch. Except for this comment, looks good.

::: src/nautilus-connect-server-dialog.c
@@ +530,3 @@
+	temp = g_strconcat (meth->scheme, "://", NULL);
+	if (g_str_has_prefix (server, temp)) {
+		stripped_server = g_strdup (&server[strlen (meth->scheme) + 3]);

Can't you just do stripped_server = g_strdup (server + strlen (temp)); ?
Comment 6 Cosimo Cecchi 2011-04-04 00:37:17 UTC
(In reply to comment #3)
> The problem is what to do if the method's scheme (e.g.,
> ftp) doesn't match the server's scheme (e.g., ssh)... Comments are welcome.

I think it's just fine to error out in that case, so feel free to remove the FIXME too.
Comment 7 Cosimo Cecchi 2011-05-23 15:22:43 UTC
I pushed this now to master and gnome-3-0 for 3.0.2, with the fix I suggested here.