gvfs r2288 - in trunk: . client



Author: alexl
Date: Thu Mar  5 14:26:48 2009
New Revision: 2288
URL: http://svn.gnome.org/viewvc/gvfs?rev=2288&view=rev

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



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

Modified: trunk/client/gdaemonvfs.c
==============================================================================
--- trunk/client/gdaemonvfs.c	(original)
+++ trunk/client/gdaemonvfs.c	Thu Mar  5 14:26:48 2009
@@ -234,7 +234,7 @@
 	      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);

Modified: trunk/client/gvfsuriutils.c
==============================================================================
--- trunk/client/gvfsuriutils.c	(original)
+++ trunk/client/gvfsuriutils.c	Thu Mar  5 14:26:48 2009
@@ -225,7 +225,7 @@
 	  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_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)
 	{



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