diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-03-20 09:59:58 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-03-20 09:59:58 +0000 |
commit | 742ed7454a772ce71b80c168233751eb90756152 (patch) | |
tree | 84885bd9ac7e343164338639c52954d53b437bf1 | |
parent | 5e732a701330a0eceb7ad129bc7dabbdee4b0fde (diff) | |
download | gvfs-742ed7454a772ce71b80c168233751eb90756152.tar.gz |
Bug 548648 – g_daemon_vfs_parse_name() fails to parse user names with
2009-03-20 Alexander Larsson <alexl@redhat.com>
Bug 548648 – g_daemon_vfs_parse_name() fails to parse user names with '@' chars
* client/gvfsuriutils.c (g_vfs_decode_uri):
Make sure multiple @ in the authority part are put in the username.
This is an invalid uri, but we might as well handle it in the better way.
svn path=/trunk/; revision=2345
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | client/gvfsuriutils.c | 6 |
2 files changed, 12 insertions, 1 deletions
@@ -1,3 +1,10 @@ +2009-03-20 Alexander Larsson <alexl@redhat.com> + + Bug 548648 – g_daemon_vfs_parse_name() fails to parse user names with '@' chars + * client/gvfsuriutils.c (g_vfs_decode_uri): + Make sure multiple @ in the authority part are put in the username. + This is an invalid uri, but we might as well handle it in the better way. + 2009-03-19 Alexander Larsson <alexl@redhat.com> * daemon/gvfsbackendsftp.c: diff --git a/client/gvfsuriutils.c b/client/gvfsuriutils.c index 206d5a7e..2cb2a622 100644 --- a/client/gvfsuriutils.c +++ b/client/gvfsuriutils.c @@ -155,7 +155,11 @@ g_vfs_decode_uri (const char *uri) authority = [ userinfo "@" ] host [ ":" port ] */ - userinfo_end = memchr (authority_start, '@', authority_end - authority_start); + /* Look for the last so that any multiple @ signs are put in the username part. + * This is not quite correct, as @ should be escaped here, but this happens + * in practice, so lets handle it the "nicer" way at least. */ + userinfo_end = g_strrstr_len (authority_start, + authority_end - authority_start, "@"); if (userinfo_end) { userinfo_start = authority_start; |