summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2023-02-27 10:54:25 +0100
committerOndrej Holy <oholy@redhat.com>2023-02-28 08:24:38 +0000
commita2c296badc9fb4ddca06a49339c1ffbb9568a69d (patch)
tree4be21ffd4a9434e3a89f4210538f62968ca38001
parent745e3031f6390aa7b393e56da8a74e01644de3bd (diff)
downloadgvfs-a2c296badc9fb4ddca06a49339c1ffbb9568a69d.tar.gz
gdaemonfile: Disable push/pull for Flatpak
The push/pull methods rely on local paths. This is a problem for Flatpak applications because the GVfs daemons run outside of it, so the same local path might refer to a different file. Let's disable the push/pull methods for Flatpak applications to fix errors when moving/copying. Related: https://github.com/flathub/org.libreoffice.LibreOffice/issues/23
-rw-r--r--client/gdaemonfile.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c
index 2d09f6af..39847ddf 100644
--- a/client/gdaemonfile.c
+++ b/client/gdaemonfile.c
@@ -2680,6 +2680,7 @@ file_transfer (GFile *source,
gboolean dest_is_daemon;
gboolean native_transfer;
gboolean send_progress;
+ gboolean flatpak_sandbox;
GVfsDBusMount *proxy;
gchar *path1, *path2;
GDBusConnection *connection;
@@ -2695,13 +2696,14 @@ file_transfer (GFile *source,
source_is_daemon = G_IS_DAEMON_FILE (source);
dest_is_daemon = G_IS_DAEMON_FILE (destination);
send_progress = progress_callback != NULL;
+ flatpak_sandbox = g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS);
serial = 0;
if (source_is_daemon && dest_is_daemon)
native_transfer = TRUE;
- else if (dest_is_daemon && !source_is_daemon)
+ else if (dest_is_daemon && !source_is_daemon && !flatpak_sandbox)
local_path = g_file_get_path (source);
- else if (source_is_daemon && !dest_is_daemon)
+ else if (source_is_daemon && !dest_is_daemon && !flatpak_sandbox)
local_path = g_file_get_path (destination);
else
{