summaryrefslogtreecommitdiff
path: root/client/gvfsuriutils.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2009-03-05 14:26:48 +0000
committerAlexander Larsson <alexl@src.gnome.org>2009-03-05 14:26:48 +0000
commit090fa3125af62356c27bb4873b87a4d72ccfae63 (patch)
treea2b3c4cc7e3ba984da139e793dfb26c35868b6d2 /client/gvfsuriutils.c
parent33824d8b0733ee95e0d5af5c2f65919d3cd5da67 (diff)
downloadgvfs-090fa3125af62356c27bb4873b87a4d72ccfae63.tar.gz
Bug 569199 – incorrectly open smb workgroup using a space
2009-03-05 Alexander Larsson <alexl@redhat.com> Bug 569199 – incorrectly open smb workgroup using a space * client/gvfsuriutils.c (g_vfs_encode_uri), (g_vfs_decode_uri): Escape and unescape host part too. This means we handle e.g. smb workgroups with spaces in them. Allowing escapes in hostnames complies with RFC 3986. * client/gdaemonvfs.c (get_mountspec_from_uri): Fix indentation svn path=/trunk/; revision=2288
Diffstat (limited to 'client/gvfsuriutils.c')
-rw-r--r--client/gvfsuriutils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/client/gvfsuriutils.c b/client/gvfsuriutils.c
index c9bae69b..206d5a7e 100644
--- a/client/gvfsuriutils.c
+++ b/client/gvfsuriutils.c
@@ -225,7 +225,7 @@ g_vfs_decode_uri (const char *uri)
decoded->port = -1;
}
- decoded->host = g_strndup (host_start, host_end - host_start);
+ decoded->host = g_uri_unescape_segment (host_start, host_end, NULL);
hier_part_start = authority_end;
}
@@ -261,7 +261,10 @@ g_vfs_encode_uri (GDecodedUri *decoded, gboolean allow_utf8)
g_string_append_c (uri, '@');
}
- g_string_append (uri, decoded->host);
+ g_string_append_uri_escaped (uri, decoded->host,
+ /* Allowed unescaped in hostname / ip address */
+ G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":[]" ,
+ allow_utf8);
if (decoded->port != -1)
{