gvfs r2345 - in trunk: . client



Author: alexl
Date: Fri Mar 20 09:59:58 2009
New Revision: 2345
URL: http://svn.gnome.org/viewvc/gvfs?rev=2345&view=rev

Log:
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.




Modified:
   trunk/ChangeLog
   trunk/client/gvfsuriutils.c

Modified: trunk/client/gvfsuriutils.c
==============================================================================
--- trunk/client/gvfsuriutils.c	(original)
+++ trunk/client/gvfsuriutils.c	Fri Mar 20 09:59:58 2009
@@ -155,7 +155,11 @@
 	      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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]