From 742ed7454a772ce71b80c168233751eb90756152 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Fri, 20 Mar 2009 09:59:58 +0000 Subject: =?UTF-8?q?Bug=20548648=20=E2=80=93=20g=5Fdaemon=5Fvfs=5Fparse=5Fn?= =?UTF-8?q?ame()=20fails=20to=20parse=20user=20names=20with?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2009-03-20 Alexander Larsson 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 --- client/gvfsuriutils.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'client') 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; -- cgit v1.2.1