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 568579 - GVFS should support FTP URLs with passwords (and ports).
GVFS should support FTP URLs with passwords (and ports).
Status: RESOLVED DUPLICATE of bug 520915
Product: gvfs
Classification: Core
Component: ftp backend
1.0.x
Other All
: Normal minor
: ---
Assigned To: gvfs-maint
gvfs-maint
Depends on:
Blocks:
 
 
Reported: 2009-01-21 17:32 UTC by ArtemGr
Modified: 2009-02-12 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase. Should pring "Mounted". (1.15 KB, text/plain)
2009-01-21 17:37 UTC, ArtemGr
Details

Description ArtemGr 2009-01-21 17:32:31 UTC
Both RFC 1738 and RFC 2396 specify a way to include password in the (FTP) URL. Specifying password in the URL is supported by many FTP clients (ncftp, lftp, Midnight Commander, Total Commander, Firefox, MSIE, to mention the few). GVFS should support this too.

Other information:
-- Currently the password is ignored in the URL.
-- Here is a real FTP url opened without problems:

[artemgr@pcbsd ~]$ ncftp ftp://6opn3w:6ad6c78df54@89.208.156.30:57320/
NcFTP 3.2.2 (Aug 18, 2008) by Mike Gleason (http://www.NcFTP.com/contact/).
Connecting to 89.208.156.30...
Service ready for new user.
Logging in...
User logged in, proceed.
Logged in to 89.208.156.30.
Current remote directory is /.
ncftp / >

-- Here is a problematic session with gvfs-mount using the same URL:

[artemgr@pcbsd ~]$ gvfs-mount ftp://6opn3w:6ad6c78df54@89.208.156.30:57320/
Enter password for ftp on 89.208.156.30:57320
Password:

-- Here is a C++ example of the problematic behaviour:

[artemgr@pcbsd ~/bin]$ cat gvfs.test.cc
// Compile with:
// g++ -O -g3 -Wall `pkg-config --cflags --libs glib-2.0` `pkg-config --cflags --libs gio-2.0` gvfs.test.cc -o gvfs.test

#include <glib.h>
#include <gio/gio.h>
#include <unistd.h>

GMainLoop * mainLoop = NULL;

void mountCallback (GObject *source_object, GAsyncResult *res, gpointer user_data) {
  // http://library.gnome.org/devel/gio/stable/GFile.html#g-file-mount-mountable-finish
  GError * error = NULL;
  if (g_file_mount_enclosing_volume_finish (G_FILE (source_object), res, &error) == TRUE) {
    g_print ("Mounted.\n");
  } else {
    g_print ("Error: %s\n", error->message);
  }
  g_main_loop_quit (mainLoop);
};

int main (int argc, char** argv) {
  g_type_init ();
  mainLoop = g_main_loop_new (NULL, FALSE);

  // http://library.gnome.org/devel/gio/stable/GFile.html#g-file-new-for-uri
  GFile * ftp = g_file_new_for_uri ("ftp://6opn3w:6ad6c78df54@89.208.156.30:57320/");

  g_print ("Mounting...\n");
  // http://library.gnome.org/devel/gio/stable/GFile.html#g-file-mount-enclosing-volume
  g_file_mount_enclosing_volume (ftp, G_MOUNT_MOUNT_NONE, NULL, NULL, mountCallback, NULL);
  g_object_unref (ftp);

  g_print ("Looping...\n");
  g_main_loop_run (mainLoop);
};
[artemgr@pcbsd ~/bin]$ ./gvfs.test
Mounting...
Looping...
Error: Password dialog cancelled
Comment 1 ArtemGr 2009-01-21 17:37:38 UTC
Created attachment 126934 [details]
Testcase. Should pring "Mounted".
Comment 2 Andreas Henriksson 2009-02-12 08:15:07 UTC
This is not specific to the ftp backend.

Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 520915 ***