[gvfs] Revert "sftp: Always use port 22 if not specified"
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] Revert "sftp: Always use port 22 if not specified"
- Date: Tue, 1 Oct 2019 13:01:39 +0000 (UTC)
commit 1bef948db2bdeb0fd94322d2b71a5945a02140e2
Author: Ondrej Holy <oholy redhat com>
Date: Tue Oct 1 14:51:38 2019 +0200
Revert "sftp: Always use port 22 if not specified"
This reverts commit 1a38caf8bcb4e02b68f8062319ef7736796a7e64.
daemon/gvfsbackendsftp.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 3feccc9c..a2f353b0 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -1134,7 +1134,7 @@ handle_login (GVfsBackend *backend,
"sftp",
object,
authtype,
- op_backend->port != 22 ?
+ op_backend->port != -1 ?
op_backend->port
:
0,
@@ -1330,7 +1330,7 @@ handle_login (GVfsBackend *backend,
"sftp",
object,
authtype,
- op_backend->port != 22 ?
+ op_backend->port != -1 ?
op_backend->port
:
0,
@@ -1995,7 +1995,7 @@ do_mount (GVfsBackend *backend,
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 != 22)
+ if (op_backend->port != -1)
{
char *v;
v = g_strdup_printf ("%d", op_backend->port);
@@ -2065,10 +2065,12 @@ try_mount (GVfsBackend *backend,
}
port = g_mount_spec_get (mount_spec, "port");
- op_backend->port = 22;
+ op_backend->port = -1;
if (port != NULL)
{
- op_backend->port = atoi (port);
+ int p = atoi (port);
+ if (p != 22)
+ op_backend->port = p;
}
user = g_mount_spec_get (mount_spec, "user");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]