Compare commits

..

No commits in common. "c8-beta" and "c8" have entirely different histories.
c8-beta ... c8

2 changed files with 95 additions and 1 deletions

83
SOURCES/4155.patch Normal file
View File

@ -0,0 +1,83 @@
From d9fec76b594fccc6eda3ce04a74beae1c8b8c1d2 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Fri, 12 Jul 2024 11:14:10 +0200
Subject: [PATCH] gfile: Add support for x-gvfs-trash mount option
Currently, the trash functionality is disabled for system internal mounts.
That might be a problem in some cases. The `x-gvfs-notrash` mount option
allows disabling the trash functionality for certain mounts. Let's add
support for the `x-gvfs-trash` mount option to allow the opposite.
See: https://issues.redhat.com/browse/RHEL-46828
---
gio/gfile.c | 7 +++++--
gio/glocalfile.c | 22 +++++++++++++---------
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/gio/gfile.c b/gio/gfile.c
index 4f9b9c6750..5ac73c03e8 100644
--- a/gio/gfile.c
+++ b/gio/gfile.c
@@ -4744,10 +4744,13 @@ g_file_delete_finish (GFile *file,
*
* Sends @file to the "Trashcan", if possible. This is similar to
* deleting it, but the user can recover it before emptying the trashcan.
- * Not all file systems support trashing, so this call can return the
+ * Trashing is disabled for system mounts by default (see
+ * g_unix_mount_is_system_internal()), so this call can return the
* %G_IO_ERROR_NOT_SUPPORTED error. Since GLib 2.66, the `x-gvfs-notrash` unix
- * mount option can be used to disable g_file_trash() support for certain
+ * mount option can be used to disable g_file_trash() support for particular
* mounts, the %G_IO_ERROR_NOT_SUPPORTED error will be returned in that case.
+ * Since 2.82, the `x-gvfs-trash` unix mount option can be used to enable
+ * g_file_trash() support for particular system mounts.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
diff --git a/gio/glocalfile.c b/gio/glocalfile.c
index 7b70c614c6..ac918d25e3 100644
--- a/gio/glocalfile.c
+++ b/gio/glocalfile.c
@@ -1807,10 +1807,6 @@ ignore_trash_mount (GUnixMountEntry *mount)
{
GUnixMountPoint *mount_point = NULL;
const gchar *mount_options;
- gboolean retval = TRUE;
-
- if (g_unix_mount_is_system_internal (mount))
- return TRUE;
mount_options = g_unix_mount_get_options (mount);
if (mount_options == NULL)
@@ -1819,15 +1815,23 @@ ignore_trash_mount (GUnixMountEntry *mount)
NULL);
if (mount_point != NULL)
mount_options = g_unix_mount_point_get_options (mount_point);
+
+ g_clear_pointer (&mount_point, g_unix_mount_point_free);
}
- if (mount_options == NULL ||
- strstr (mount_options, "x-gvfs-notrash") == NULL)
- retval = FALSE;
+ if (mount_options != NULL)
+ {
+ if (strstr (mount_options, "x-gvfs-trash") != NULL)
+ return FALSE;
+
+ if (strstr (mount_options, "x-gvfs-notrash") != NULL)
+ return TRUE;
+ }
- g_clear_pointer (&mount_point, g_unix_mount_point_free);
+ if (g_unix_mount_is_system_internal (mount))
+ return TRUE;
- return retval;
+ return FALSE;
}
static gboolean
--
GitLab

View File

@ -5,7 +5,7 @@
Name: glib2 Name: glib2
Version: 2.56.4 Version: 2.56.4
Release: 163%{?dist} Release: 165%{?dist}
Summary: A library of handy utility functions Summary: A library of handy utility functions
License: LGPLv2+ License: LGPLv2+
@ -125,6 +125,9 @@ Patch22: 54.patch
# Also: https://gitlab.gnome.org/GNOME/glib/-/commit/d0821da5244fd08c756a5f84ec0d3063c72d1ac6 # Also: https://gitlab.gnome.org/GNOME/glib/-/commit/d0821da5244fd08c756a5f84ec0d3063c72d1ac6
Patch23: 1549.patch Patch23: 1549.patch
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4155
Patch24: 4155.patch
%description %description
GLib is the low-level core library that forms the basis for projects GLib is the low-level core library that forms the basis for projects
such as GTK+ and GNOME. It provides data structure handling for C, such as GTK+ and GNOME. It provides data structure handling for C,
@ -322,6 +325,14 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%{_datadir}/installed-tests %{_datadir}/installed-tests
%changelog %changelog
* Thu Sep 26 2024 Ondrej Holy <oholy@redhat.com> - 2.56.4-165
- Add support for x-gvfs-trash mount option
- Resolves: RHEL-46828
* Tue Feb 13 2024 Michael Catanzaro <mcatanzaro@redhat.com> - 2.56.4-164
- Revert GUnixMountMonitor changes (it depends on functionality not in RHEL 8)
- Resolves: RHEL-23636
* Thu Feb 01 2024 Michael Catanzaro <mcatanzaro@redhat.com> - 2.56.4-163 * Thu Feb 01 2024 Michael Catanzaro <mcatanzaro@redhat.com> - 2.56.4-163
- Backport GUnixMountMonitor port to libmnt_monitor - Backport GUnixMountMonitor port to libmnt_monitor
- Make GUnixMountMonitor thread-safe - Make GUnixMountMonitor thread-safe