[gvfs] dav: Unescape the path when setting the mount_prefix of the GMountSpec



commit d919fe04ded8224e288993e76b251e596cf94fab
Author: Christian Kellner <gicmo gnome org>
Date:   Mon May 16 14:17:28 2011 +0200

    dav: Unescape the path when setting the mount_prefix of the GMountSpec
    
    As of commit 6e2f67 we escape the path of the mount_base. Later when we
    set the mount_prefix of the backend's mount_spec we do use the mount_base
    for this. We therefore have to unescape the path again because otherwise
    comparing paths won't work in the client.

 daemon/gvfsbackenddav.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index 0d15e7a..5fc3c9f 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -1513,6 +1513,7 @@ g_mount_spec_from_dav_uri (GVfsBackendDav *dav_backend,
 {
   GMountSpec *spec;
   const char *ssl;
+  char       *local_path;
 
 #ifdef HAVE_AVAHI
   if (dav_backend->resolver != NULL)
@@ -1555,7 +1556,11 @@ g_mount_spec_from_dav_uri (GVfsBackendDav *dav_backend,
       g_free (port);
     }
 
-  g_mount_spec_set_mount_prefix (spec, uri->path);
+  /* There must not be any illegal characters in the
+     URL at this point */
+  local_path = g_uri_unescape_string (uri->path, "/");
+  g_mount_spec_set_mount_prefix (spec, local_path);
+  g_free (local_path);
 
   return spec;
 }



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