mirror of https://gitee.com/openkylin/glib2.0.git
42 lines
1.5 KiB
Diff
42 lines
1.5 KiB
Diff
From: Debian GNOME Maintainers
|
|
<pkg-gnome-maintainers@lists.alioth.debian.org>
|
|
Date: Wed, 29 Jun 2022 08:02:49 +0000
|
|
Subject: fix-trash-issue-in-data-usershare
|
|
|
|
===================================================================
|
|
---
|
|
gio/glocalfile.c | 6 ++++--
|
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/gio/glocalfile.c b/gio/glocalfile.c
|
|
index 72ef947..bb7c863 100644
|
|
--- a/gio/glocalfile.c
|
|
+++ b/gio/glocalfile.c
|
|
@@ -1951,6 +1951,7 @@ g_local_file_trash (GFile *file,
|
|
GVfsClass *class;
|
|
GVfs *vfs;
|
|
int errsv;
|
|
+ gboolean is_local_file_in_usershare = FALSE;
|
|
|
|
if (glib_should_use_portal ())
|
|
return g_trash_portal_trash_file (file, error);
|
|
@@ -1988,7 +1989,8 @@ g_local_file_trash (GFile *file,
|
|
g_free (path);
|
|
}
|
|
|
|
- if (file_stat.st_dev == home_stat.st_dev)
|
|
+ is_local_file_in_usershare = g_str_has_prefix(local->filename, "/data/usershare");
|
|
+ if (file_stat.st_dev == home_stat.st_dev && !is_local_file_in_usershare)
|
|
{
|
|
is_homedir_trash = TRUE;
|
|
errno = 0;
|
|
@@ -2028,7 +2030,7 @@ g_local_file_trash (GFile *file,
|
|
}
|
|
|
|
mount = g_unix_mount_at (topdir, NULL);
|
|
- if (mount == NULL || g_unix_mount_is_system_internal (mount))
|
|
+ if (mount == NULL || g_unix_mount_is_system_internal (mount) && !is_local_file_in_usershare)
|
|
{
|
|
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
|
_("Trashing on system internal mounts is not supported"));
|