diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-03-05 14:26:48 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-03-05 14:26:48 +0000 |
commit | 090fa3125af62356c27bb4873b87a4d72ccfae63 (patch) | |
tree | a2b3c4cc7e3ba984da139e793dfb26c35868b6d2 | |
parent | 33824d8b0733ee95e0d5af5c2f65919d3cd5da67 (diff) | |
download | gvfs-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
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | client/gdaemonvfs.c | 2 | ||||
-rw-r--r-- | client/gvfsuriutils.c | 7 |
3 files changed, 19 insertions, 3 deletions
@@ -1,5 +1,18 @@ 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 + +2009-03-05 Alexander Larsson <alexl@redhat.com> + Bug 573381 – Memory leak in ftp_connection_parse_features() * daemon/gvfsbackendftp.c (ftp_connection_parse_features): diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c index 94f7e9ba..c9f2cc97 100644 --- a/client/gdaemonvfs.c +++ b/client/gdaemonvfs.c @@ -234,7 +234,7 @@ get_mountspec_from_uri (GDaemonVfs *vfs, if (mountable && mountable->host_is_inet) { /* Convert hostname to lower case */ - str_tolower_inplace (decoded->host); + str_tolower_inplace (decoded->host); /* Remove brackets aroung ipv6 addresses */ l = strlen (decoded->host); 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) { |