Add support for x-gvfs-trash mount option
Resolves: RHEL-52342
This commit is contained in:
		
							parent
							
								
									313a3fbe16
								
							
						
					
					
						commit
						57cc471821
					
				| @ -25,7 +25,7 @@ | |||||||
| 
 | 
 | ||||||
| Name: gvfs | Name: gvfs | ||||||
| Version: 1.36.2 | Version: 1.36.2 | ||||||
| Release: 16%{?dist} | Release: 17%{?dist} | ||||||
| Summary: Backends for the gio framework in GLib | Summary: Backends for the gio framework in GLib | ||||||
| 
 | 
 | ||||||
| License: GPLv3 and LGPLv2+ and BSD and MPLv2.0 | License: GPLv3 and LGPLv2+ and BSD and MPLv2.0 | ||||||
| @ -80,6 +80,9 @@ Patch15: google-performance-fixes.patch | |||||||
| Patch16: trash-Add-support-for-x-gvfs-notrash-option-to-ignor.patch | Patch16: trash-Add-support-for-x-gvfs-notrash-option-to-ignor.patch | ||||||
| Patch17: trash-Sync-trash-dir-items-when-files-change.patch | Patch17: trash-Sync-trash-dir-items-when-files-change.patch | ||||||
| 
 | 
 | ||||||
|  | # https://issues.redhat.com/browse/RHEL-52342 | ||||||
|  | Patch18: trash-Add-support-for-x-gvfs-trash-mount-option.patch | ||||||
|  | 
 | ||||||
| BuildRequires: pkgconfig | BuildRequires: pkgconfig | ||||||
| BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} | BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} | ||||||
| BuildRequires: pkgconfig(dbus-glib-1) | BuildRequires: pkgconfig(dbus-glib-1) | ||||||
| @ -470,6 +473,9 @@ killall -USR1 gvfsd >&/dev/null || : | |||||||
| %{_datadir}/installed-tests | %{_datadir}/installed-tests | ||||||
| 
 | 
 | ||||||
| %changelog | %changelog | ||||||
|  | * Thu Sep 26 2024 Ondrej Holy <oholy@redhat.com> - 1.36.2-17 | ||||||
|  | - Add support for x-gvfs-trash mount option (RHEL-52342) | ||||||
|  | 
 | ||||||
| * Wed Dec 06 2023 Ondrej Holy <oholy@redhat.com> - 1.36.2-16 | * Wed Dec 06 2023 Ondrej Holy <oholy@redhat.com> - 1.36.2-16 | ||||||
| - Sync trash dir items when files change (RHEL-2824) | - Sync trash dir items when files change (RHEL-2824) | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										64
									
								
								trash-Add-support-for-x-gvfs-trash-mount-option.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								trash-Add-support-for-x-gvfs-trash-mount-option.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,64 @@ | |||||||
|  | From 1c2cc7c0b80e5fc3f59e8557232bb6ff8ebbab7a Mon Sep 17 00:00:00 2001 | ||||||
|  | From: Ondrej Holy <oholy@redhat.com> | ||||||
|  | Date: Fri, 12 Jul 2024 13:21:49 +0200 | ||||||
|  | Subject: [PATCH] trash: 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 | ||||||
|  | 
 | ||||||
|  | Related: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4155 | ||||||
|  | ---
 | ||||||
|  |  daemon/trashlib/trashwatcher.c | 22 +++++++++++++--------- | ||||||
|  |  1 file changed, 13 insertions(+), 9 deletions(-) | ||||||
|  | 
 | ||||||
|  | diff --git a/daemon/trashlib/trashwatcher.c b/daemon/trashlib/trashwatcher.c
 | ||||||
|  | index eec32d0b..707323cb 100644
 | ||||||
|  | --- a/daemon/trashlib/trashwatcher.c
 | ||||||
|  | +++ b/daemon/trashlib/trashwatcher.c
 | ||||||
|  | @@ -218,10 +218,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) | ||||||
|  | @@ -230,15 +226,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;
 | ||||||
|  |   | ||||||
|  | -  g_clear_pointer (&mount_point, g_unix_mount_point_free);
 | ||||||
|  | +      if (strstr (mount_options, "x-gvfs-notrash") != NULL)
 | ||||||
|  | +        return TRUE;
 | ||||||
|  | +    }
 | ||||||
|  | +
 | ||||||
|  | +  if (g_unix_mount_is_system_internal (mount))
 | ||||||
|  | +    return TRUE;
 | ||||||
|  |   | ||||||
|  | -  return retval;
 | ||||||
|  | +  return FALSE;
 | ||||||
|  |  } | ||||||
|  |   | ||||||
|  |  static void | ||||||
|  | -- 
 | ||||||
|  | 2.46.1 | ||||||
|  | 
 | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user