summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2017-08-21 14:33:12 +0200
committerOndrej Holy <oholy@redhat.com>2017-08-21 14:50:44 +0200
commitdd2b1ff8cfb28434f35b0657b9becd059ecf3c08 (patch)
tree405d57690fe5d98fd28fe0a7757ee826b76fd3b2 /monitor
parent8cc160ec87f80bb2740959b98bf78b821970e27d (diff)
downloadgvfs-dd2b1ff8cfb28434f35b0657b9becd059ecf3c08.tar.gz
proxy: Fix shadow mount handling for equal paths
Automatic shadow mount handling in some cases works currently only thanks to the bug in g_daemon_file_prefix_matches implementation, which I am going to fix. The problematic case is when activation_root is equal to mount_root (e.g. Nextcloud integration). The bug in _prefix_matches causes that it succeeds also if the paths are equal, but this is wrong as per the docs. Let's use also g_file_equal when looking for shadow mounts in order to fix this issue. https://bugzilla.gnome.org/show_bug.cgi?id=786217
Diffstat (limited to 'monitor')
-rw-r--r--monitor/proxy/gproxyvolume.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/monitor/proxy/gproxyvolume.c b/monitor/proxy/gproxyvolume.c
index fc24f15f..c76ec556 100644
--- a/monitor/proxy/gproxyvolume.c
+++ b/monitor/proxy/gproxyvolume.c
@@ -265,7 +265,8 @@ update_shadow_mount (GProxyVolume *volume)
continue;
mount_root = g_mount_get_root (mount);
- prefix_matches = g_file_has_prefix (activation_root, mount_root);
+ prefix_matches = (g_file_has_prefix (activation_root, mount_root) ||
+ g_file_equal (activation_root, mount_root));
g_object_unref (mount_root);
if (prefix_matches)
{