GNOME Bugzilla – Bug 568579
GVFS should support FTP URLs with passwords (and ports).
Last modified: 2009-02-12 08:15:07 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
Created attachment 126934 [details] Testcase. Should pring "Mounted".
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 ***