summaryrefslogtreecommitdiff
path: root/daemon/gvfsbackendsftp.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-03-02 12:16:28 +0000
committerAlexander Larsson <alexl@src.gnome.org>2009-03-02 12:16:28 +0000
commitc5c691e410a175107a7aae39b47393f200450435 (patch)
treeff79aace9e3439f4bed5bbedb4856d25851a55b5 /daemon/gvfsbackendsftp.c
parentf4ea83db5db63222155c03a8d17025e0b4a160b7 (diff)
downloadgvfs-c5c691e410a175107a7aae39b47393f200450435.tar.gz
Bug 550929 – nautilus sftp:// doesn't read User in ~/.ssh/config
2009-03-02 Alexander Larsson <alexl@redhat.com> Bug 550929 – nautilus sftp:// doesn't read User in ~/.ssh/config * daemon/gvfsbackendsftp.c: Don't specify user unless requested explicitly by the uri. Patch from Christian Neumair svn path=/trunk/; revision=2272
Diffstat (limited to 'daemon/gvfsbackendsftp.c')
-rw-r--r--daemon/gvfsbackendsftp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 87b265e8..90cd9942 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -365,8 +365,11 @@ setup_ssh_commandline (GVfsBackend *backend)
}
- args[last_arg++] = g_strdup ("-l");
- args[last_arg++] = g_strdup (op_backend->user);
+ if (op_backend->user_specified)
+ {
+ args[last_arg++] = g_strdup ("-l");
+ args[last_arg++] = g_strdup (op_backend->user);
+ }
args[last_arg++] = g_strdup ("-s");
@@ -885,10 +888,14 @@ handle_login (GVfsBackend *backend,
else
password_in_keyring = TRUE;
- if (new_user && strcmp (new_user, op_backend->user) != 0)
+ if (new_user &&
+ (op_backend->user == NULL ||
+ strcmp (new_user, op_backend->user) != 0))
{
g_free (op_backend->user);
op_backend->user = new_user;
+
+ op_backend->user_specified = TRUE;
g_free (op_backend->tmp_password);
op_backend->tmp_password = new_password;
@@ -1584,8 +1591,6 @@ try_mount (GVfsBackend *backend,
op_backend->user = g_strdup (user);
if (op_backend->user)
op_backend->user_specified = TRUE;
- else
- op_backend->user = g_strdup (g_get_user_name ());
return FALSE;
}