Compare commits

...

No commits in common. "imports/c8-beta/gvfs-1.36.2-11.el8" and "c8" have entirely different histories.

7 changed files with 3054 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,43 @@
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 33d1a209..776b67bc 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -513,7 +513,13 @@ do_mount (GVfsBackend *backend,
if (res == 0)
break;
- if (op_backend->mount_cancelled || (errsv != EACCES && errsv != EPERM))
+ if (errsv == EINVAL && op_backend->mount_try == 0 && op_backend->user == NULL)
+ {
+ /* EINVAL is "expected" when kerberos/ccache is misconfigured, see:
+ * https://gitlab.gnome.org/GNOME/gvfs/-/issues/611
+ */
+ }
+ else if (op_backend->mount_cancelled || (errsv != EACCES && errsv != EPERM))
{
g_debug ("do_mount - (errno != EPERM && errno != EACCES), cancelled = %d, breaking\n", op_backend->mount_cancelled);
break;
diff --git a/daemon/gvfsbackendsmbbrowse.c b/daemon/gvfsbackendsmbbrowse.c
index 57bae9db..7e8facfb 100644
--- a/daemon/gvfsbackendsmbbrowse.c
+++ b/daemon/gvfsbackendsmbbrowse.c
@@ -967,8 +967,14 @@ do_mount (GVfsBackend *backend,
uri, op_backend->mount_try, dir, op_backend->mount_cancelled,
errsv, g_strerror (errsv));
- if (dir == NULL &&
- (op_backend->mount_cancelled || (errsv != EPERM && errsv != EACCES)))
+ if (errsv == EINVAL && op_backend->mount_try == 0 && op_backend->user == NULL)
+ {
+ /* EINVAL is "expected" when kerberos is misconfigured, see:
+ * https://gitlab.gnome.org/GNOME/gvfs/-/issues/611
+ */
+ }
+ else if (dir == NULL &&
+ (op_backend->mount_cancelled || (errsv != EPERM && errsv != EACCES)))
{
g_debug ("do_mount - (errno != EPERM && errno != EACCES), cancelled = %d, breaking\n", op_backend->mount_cancelled);
break;
--
2.35.1

View File

@ -0,0 +1,57 @@
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index 776b67bc..a1e3eacd 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -80,7 +80,6 @@ struct _GVfsBackendSmb
int mount_try;
gboolean mount_try_again;
gboolean mount_cancelled;
- gboolean use_anonymous;
gboolean password_in_keyring;
GPasswordSave password_save;
@@ -215,13 +214,6 @@ auth_callback (SMBCCTX *context,
backend->mount_try_again = TRUE;
g_debug ("auth_callback - kerberos pass\n");
}
- else if (backend->use_anonymous)
- {
- /* Try again if anonymous login fails */
- backend->use_anonymous = FALSE;
- backend->mount_try_again = TRUE;
- g_debug ("auth_callback - anonymous login pass\n");
- }
else
{
gboolean in_keyring = FALSE;
@@ -304,10 +296,13 @@ auth_callback (SMBCCTX *context,
/* Try again if this fails */
backend->mount_try_again = TRUE;
+ smbc_setOptionNoAutoAnonymousLogin (backend->smb_context,
+ !anonymous);
+
if (anonymous)
{
- backend->use_anonymous = TRUE;
backend->password_save = FALSE;
+ g_debug ("auth_callback - anonymous enabled\n");
}
else
{
@@ -535,12 +530,6 @@ do_mount (GVfsBackend *backend,
smbc_setOptionFallbackAfterKerberos (op_backend->smb_context, 1);
}
- /* If the AskPassword reply requested anonymous login, enable the
- * anonymous fallback and try again.
- */
- smbc_setOptionNoAutoAnonymousLogin (op_backend->smb_context,
- !op_backend->use_anonymous);
-
op_backend->mount_try ++;
}
while (op_backend->mount_try_again);
--
2.36.0

View File

@ -0,0 +1,67 @@
From 3f6f906c7c7b28dc30edb98200b6e13e1a513bb4 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 9 May 2018 12:54:59 +0200
Subject: [PATCH] smb: Use O_RDWR to fix fstat when writing
fstat fails with EINVAL on Windows servers if O_WRONLY is used to open
(though it works properly on SAMBA servers). O_RDWR is needed to make
it work. This causes issues when copying files over gvfsd-fuse among
others.
https://bugzilla.gnome.org/show_bug.cgi?id=795805
---
daemon/gvfsbackendsmb.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index d4944197..9571fa0d 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -808,7 +808,7 @@ do_create (GVfsBackend *backend,
smbc_open = smbc_getFunctionOpen (op_backend->smb_context);
errno = 0;
file = smbc_open (op_backend->smb_context, uri,
- O_CREAT|O_WRONLY|O_EXCL, 0666);
+ O_CREAT|O_RDWR|O_EXCL, 0666);
g_free (uri);
if (file == NULL)
@@ -850,7 +850,7 @@ do_append_to (GVfsBackend *backend,
smbc_open = smbc_getFunctionOpen (op_backend->smb_context);
errno = 0;
file = smbc_open (op_backend->smb_context, uri,
- O_CREAT|O_WRONLY|O_APPEND, 0666);
+ O_CREAT|O_RDWR|O_APPEND, 0666);
g_free (uri);
if (file == NULL)
@@ -916,7 +916,7 @@ open_tmpfile (GVfsBackendSmb *backend,
smbc_open = smbc_getFunctionOpen (backend->smb_context);
errno = 0;
file = smbc_open (backend->smb_context, tmp_uri,
- O_CREAT|O_WRONLY|O_EXCL, 0666);
+ O_CREAT|O_RDWR|O_EXCL, 0666);
} while (file == NULL && errno == EEXIST);
g_free (dir_uri);
@@ -1040,7 +1040,7 @@ do_replace (GVfsBackend *backend,
errno = 0;
file = smbc_open (op_backend->smb_context, uri,
- O_CREAT|O_WRONLY|O_EXCL, 0);
+ O_CREAT|O_RDWR|O_EXCL, 0);
if (file == NULL && errno != EEXIST)
{
int errsv = fixup_open_errno (errno);
@@ -1110,7 +1110,7 @@ do_replace (GVfsBackend *backend,
errno = 0;
file = smbc_open (op_backend->smb_context, uri,
- O_CREAT|O_WRONLY|O_TRUNC, 0);
+ O_CREAT|O_RDWR|O_TRUNC, 0);
if (file == NULL)
{
int errsv = fixup_open_errno (errno);
--
2.35.3

View File

@ -0,0 +1,65 @@
From f93bd46c36c8e42f17f0f61b79c55a3794906395 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Fri, 6 Mar 2020 10:08:09 +0100
Subject: [PATCH] trash: Add support for x-gvfs-notrash option to ignore mounts
Add support for x-gvfs-notrash mount option, which allows to ignore
trash folder on certain mounts. This might be especially useful e.g.
to prevent wakeups of autofs mounts...
https://bugzilla.redhat.com/show_bug.cgi?id=1096200
---
daemon/trashlib/trashwatcher.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/daemon/trashlib/trashwatcher.c b/daemon/trashlib/trashwatcher.c
index 6b455235..01c440a1 100644
--- a/daemon/trashlib/trashwatcher.c
+++ b/daemon/trashlib/trashwatcher.c
@@ -211,6 +211,34 @@ trash_mount_remove (TrashMount **mount_ptr)
g_slice_free (TrashMount, mount);
}
+static gboolean
+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)
+ {
+ mount_point = g_unix_mount_point_at (g_unix_mount_get_mount_path (mount),
+ NULL);
+ if (mount_point != NULL)
+ mount_options = g_unix_mount_point_get_options (mount_point);
+ }
+
+ if (mount_options == NULL ||
+ strstr (mount_options, "x-gvfs-notrash") == NULL)
+ retval = FALSE;
+
+ g_clear_pointer (&mount_point, g_unix_mount_point_free);
+
+ return retval;
+}
+
static void
trash_watcher_remount (TrashWatcher *watcher)
{
@@ -229,7 +257,7 @@ trash_watcher_remount (TrashWatcher *watcher)
{
int result;
- if (new && g_unix_mount_is_system_internal (new->data))
+ if (new && ignore_trash_mount (new->data))
{
g_unix_mount_free (new->data);
new = new->next;
--
2.41.0

View File

@ -0,0 +1,55 @@
From 41862c0179f834d8bc3bd84ce78ee495050f2676 Mon Sep 17 00:00:00 2001
From: rong wang <wangrong@uniontech.com>
Date: Thu, 23 Mar 2023 10:26:24 +0800
Subject: [PATCH] trash: Sync trash dir items when files change
In the case of an application monitoring the trash can, delete a file
on the mounted device to the trash can, and then unmount the device.
At this time, if you check the status of the trash can, you will find
that the number of files queried is inconsistent with the number of
files obtained through the enumeration job. This is because the number
of files queried includes some files that do not exist when the device
is unmounted. The solution is to synchronize the status of the trash
can in time to ensure that the trash can does not record files that do
not exist.
---
daemon/trashlib/trashdir.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/daemon/trashlib/trashdir.c b/daemon/trashlib/trashdir.c
index c470d3bd..0d7d2b1b 100644
--- a/daemon/trashlib/trashdir.c
+++ b/daemon/trashlib/trashdir.c
@@ -163,10 +163,27 @@ trash_dir_changed (GFileMonitor *monitor,
TrashDir *dir = user_data;
if (event_type == G_FILE_MONITOR_EVENT_CREATED)
- trash_root_add_item (dir->root, file, dir->topdir, dir->is_homedir);
+ {
+ dir->items = g_slist_insert_sorted (dir->items,
+ g_object_ref (file),
+ (GCompareFunc) compare_basename);
+ trash_root_add_item (dir->root, file, dir->topdir, dir->is_homedir);
+ }
else if (event_type == G_FILE_MONITOR_EVENT_DELETED)
- trash_root_remove_item (dir->root, file, dir->is_homedir);
+ {
+ GSList *node;
+
+ node = g_slist_find_custom (dir->items,
+ file,
+ (GCompareFunc) compare_basename);
+ if (node)
+ {
+ g_object_unref (node->data);
+ dir->items = g_slist_delete_link (dir->items, node);
+ }
+ trash_root_remove_item (dir->root, file, dir->is_homedir);
+ }
else if (event_type == G_FILE_MONITOR_EVENT_PRE_UNMOUNT ||
event_type == G_FILE_MONITOR_EVENT_UNMOUNTED ||
--
2.41.0

View File

@ -3,7 +3,7 @@
%global avahi_version 0.6
%global fuse_version 2.8.0
%global gettext_version 0.19.4
%global glib2_version 2.51.0
%global glib2_version 2.56.4-162
%global goa_version 3.17.1
%global gsettings_desktop_schemas_version 3.28.1-2
%global gudev_version 147
@ -25,7 +25,7 @@
Name: gvfs
Version: 1.36.2
Release: 11%{?dist}
Release: 16%{?dist}
Summary: Backends for the gio framework in GLib
License: GPLv3 and LGPLv2+ and BSD and MPLv2.0
@ -66,6 +66,20 @@ Patch10: smb-Improve-enumeration-performance.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1889411
Patch11: goa-Add-support-for-certificate-prompts.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2095712
Patch12: smb-Ignore-EINVAL-for-kerberos-login.patch
Patch13: smb-Rework-anonymous-handling-to-avoid-EINVAL.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2080478
Patch14: smb-Use-O_RDWR-to-fix-fstat-when-writing.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2083481
Patch15: google-performance-fixes.patch
# https://issues.redhat.com/browse/RHEL-2824
Patch16: trash-Add-support-for-x-gvfs-notrash-option-to-ignor.patch
Patch17: trash-Sync-trash-dir-items-when-files-change.patch
BuildRequires: pkgconfig
BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version}
BuildRequires: pkgconfig(dbus-glib-1)
@ -352,9 +366,11 @@ killall -USR1 gvfsd >&/dev/null || :
%{_libexecdir}/gvfsd-recent
%{_mandir}/man1/gvfsd.1*
%{_mandir}/man1/gvfsd-metadata.1*
%if ! 0%{?flatpak}
%{_userunitdir}/gvfs-daemon.service
%{_userunitdir}/gvfs-metadata.service
%{_userunitdir}/gvfs-udisks2-volume-monitor.service
%endif
%files client -f gvfs.lang
%{!?_licensedir:%global license %%doc}
@ -376,7 +392,9 @@ killall -USR1 gvfsd >&/dev/null || :
%files fuse
%{_libexecdir}/gvfsd-fuse
%{_mandir}/man1/gvfsd-fuse.1*
%if ! 0%{?flatpak}
%{_tmpfilesdir}/gvfsd-fuse-tmpfiles.conf
%endif
%files smb
%{_libexecdir}/gvfsd-smb
@ -396,7 +414,9 @@ killall -USR1 gvfsd >&/dev/null || :
%{_libexecdir}/gvfs-gphoto2-volume-monitor
%{_datadir}/dbus-1/services/org.gtk.vfs.GPhoto2VolumeMonitor.service
%{_datadir}/gvfs/remote-volume-monitors/gphoto2.monitor
%if ! 0%{?flatpak}
%{_userunitdir}/gvfs-gphoto2-volume-monitor.service
%endif
%ifnarch s390 s390x
%files afc
@ -405,8 +425,10 @@ killall -USR1 gvfsd >&/dev/null || :
%{_libexecdir}/gvfs-afc-volume-monitor
%{_datadir}/dbus-1/services/org.gtk.vfs.AfcVolumeMonitor.service
%{_datadir}/gvfs/remote-volume-monitors/afc.monitor
%if ! 0%{?flatpak}
%{_userunitdir}/gvfs-afc-volume-monitor.service
%endif
%endif
%files afp
%{_libexecdir}/gvfsd-afp
@ -420,7 +442,9 @@ killall -USR1 gvfsd >&/dev/null || :
%{_libexecdir}/gvfs-mtp-volume-monitor
%{_datadir}/dbus-1/services/org.gtk.vfs.MTPVolumeMonitor.service
%{_datadir}/gvfs/remote-volume-monitors/mtp.monitor
%if ! 0%{?flatpak}
%{_userunitdir}/gvfs-mtp-volume-monitor.service
%endif
%if ! 0%{?rhel}
%files nfs
@ -436,7 +460,9 @@ killall -USR1 gvfsd >&/dev/null || :
%{_datadir}/gvfs/remote-volume-monitors/goa.monitor
%{_datadir}/gvfs/mounts/google.mount
%{_libexecdir}/gvfsd-google
%if ! 0%{?flatpak}
%{_userunitdir}/gvfs-goa-volume-monitor.service
%endif
%files tests
%dir %{_libexecdir}/installed-tests
@ -444,6 +470,21 @@ killall -USR1 gvfsd >&/dev/null || :
%{_datadir}/installed-tests
%changelog
* Wed Dec 06 2023 Ondrej Holy <oholy@redhat.com> - 1.36.2-16
- Sync trash dir items when files change (RHEL-2824)
* Mon Oct 09 2023 Ondrej Holy <oholy@redhat.com> - 1.36.2-15
- Add support for x-gvfs-notrash mount option (RHEL-2824)
* Thu Jun 16 2022 Ondrej Holy <oholy@redhat.com> - 1.36.2-14
- Backport performance fixes for Google backend (#2083481)
* Tue Jun 14 2022 Ondrej Holy <oholy@redhat.com> - 1.36.2-13
- Use O_RDWR to fix fstat when writing on SMB share (#2080478)
* Tue Jun 14 2022 Ondrej Holy <oholy@redhat.com> - 1.36.2-12
- Ignore EINVAL for kerberos login to fix SMB mounting (#2095712)
* Tue Nov 03 2020 Ondrej Holy <oholy@redhat.com> - 1.36.2-11
- Add support for certificates prompts for GOA mounts (rhbz#1889411)