gvfs r2344 - in trunk: . daemon



Author: alexl
Date: Thu Mar 19 12:53:46 2009
New Revision: 2344
URL: http://svn.gnome.org/viewvc/gvfs?rev=2344&view=rev

Log:
2009-03-19  Alexander Larsson  <alexl redhat com>

        * daemon/gvfsbackendsftp.c:
	Make sure we only set the "user" part in the mountspec
	if it was in the original requested uri/mountspec to mount.
	Otherwise we might end up mounting sftp://user foo/ instead
	of sftp://foo/, and the mounting app will fail to read after
	the mount succeeds.



Modified:
   trunk/ChangeLog
   trunk/daemon/gvfsbackendsftp.c

Modified: trunk/daemon/gvfsbackendsftp.c
==============================================================================
--- trunk/daemon/gvfsbackendsftp.c	(original)
+++ trunk/daemon/gvfsbackendsftp.c	Thu Mar 19 12:53:46 2009
@@ -145,6 +145,7 @@
   char *host;
   int port;
   gboolean user_specified;
+  gboolean user_specified_in_uri;
   char *user;
   char *tmp_password;
 
@@ -1529,7 +1530,7 @@
   read_reply_async (op_backend);
 
   sftp_mount_spec = g_mount_spec_new ("sftp");
-  if (op_backend->user_specified)
+  if (op_backend->user_specified_in_uri)
     g_mount_spec_set (sftp_mount_spec, "user", op_backend->user);
   g_mount_spec_set (sftp_mount_spec, "host", op_backend->host);
   if (op_backend->port != -1)
@@ -1543,7 +1544,7 @@
   g_vfs_backend_set_mount_spec (backend, sftp_mount_spec);
   g_mount_spec_unref (sftp_mount_spec);
 
-  if (op_backend->user_specified)
+  if (op_backend->user_specified_in_uri)
     /* Translators: This is the name of an sftp share, like "sftp for <user>on <hostname>" */
     display_name = g_strdup_printf (_("sftp for %s on %s"), op_backend->user, op_backend->host);
   else
@@ -1602,7 +1603,11 @@
   op_backend->host = g_strdup (host);
   op_backend->user = g_strdup (user);
   if (op_backend->user)
-    op_backend->user_specified = TRUE;
+    {
+      op_backend->user_specified = TRUE;
+      op_backend->user_specified_in_uri = TRUE;
+    }
+      
 
   return FALSE;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]