From 2faf6d93fc2833d5b7f6da9288db1c8b98e4b7bd Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 18 Aug 2009 15:00:17 +0200
Subject: [PATCH 1/3] Include mount prefix when constructing fuse path
On complex URIs like 'dav://server/gallery/w/TestAlbum',
g_file_get_path () would return incomplete path without the
middle '/gallery/w' part (mount prefix). This patch ensures
full path to be returned.
See bug 590862 for details.
---
client/gdaemonvfs.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index 5a138b3..0382727 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -386,7 +386,6 @@ convert_fuse_path (GVfs *vfs,
if (mount_info)
{
g_object_unref (file);
- /* TODO: Do we need to look at the prefix of the mount_spec? */
file = g_daemon_file_new (mount_info->mount_spec, mount_path);
g_free (mount_path);
g_mount_info_unref (mount_info);
@@ -993,6 +992,7 @@ _g_daemon_vfs_get_mount_info_by_fuse_sync (const char *fuse_path,
DBusMessageIter iter;
DBusError derror;
int len;
+ const char *mount_path_end;
info = lookup_mount_info_by_fuse_path_in_cache (fuse_path,
mount_path);
@@ -1031,9 +1031,12 @@ _g_daemon_vfs_get_mount_info_by_fuse_sync (const char *fuse_path,
{
len = strlen (info->fuse_mountpoint);
if (fuse_path[len] == 0)
- *mount_path = g_strdup ("/");
+ mount_path_end = "/";
else
- *mount_path = g_strdup (fuse_path + len);
+ mount_path_end = fuse_path + len;
+
+ *mount_path = g_build_filename (info->mount_spec->mount_prefix,
+ mount_path_end, NULL);
}
else
{
--
1.6.4