From e888ac92c0a69f30415877bc160d406ada5a4a3d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 09 2022 09:29:16 +0000 Subject: import gvfs-1.36.2-7.el7_9 --- diff --git a/SOURCES/smb-Use-O_RDWR-to-fix-fstat-when-writing.patch b/SOURCES/smb-Use-O_RDWR-to-fix-fstat-when-writing.patch new file mode 100644 index 0000000..2142250 --- /dev/null +++ b/SOURCES/smb-Use-O_RDWR-to-fix-fstat-when-writing.patch @@ -0,0 +1,67 @@ +From 3f6f906c7c7b28dc30edb98200b6e13e1a513bb4 Mon Sep 17 00:00:00 2001 +From: Ondrej Holy +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 + diff --git a/SPECS/gvfs.spec b/SPECS/gvfs.spec index e146d7e..f751aa3 100644 --- a/SPECS/gvfs.spec +++ b/SPECS/gvfs.spec @@ -24,7 +24,7 @@ Name: gvfs Version: 1.36.2 -Release: 5%{?dist} +Release: 7%{?dist} Summary: Backends for the gio framework in GLib License: GPLv3 and LGPLv2+ and BSD and MPLv2.0 @@ -50,6 +50,9 @@ Patch4: udisks2-Fix-crashes-caused-by-missing-source-tag.patch Patch5: udisks2-Fix-leak-when-updating-fstab-volumes.patch Patch6: udisks2-Fix-leaks-of-drive-icons-description.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2093816 +Patch7: smb-Use-O_RDWR-to-fix-fstat-when-writing.patch + BuildRequires: pkgconfig BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} BuildRequires: pkgconfig(dbus-glib-1) @@ -239,6 +242,7 @@ the functionality of the installed gvfs package. %patch4 -p1 -b .udisks2-Fix-crashes-caused-by-missing-source-tag %patch5 -p1 -b .udisks2-Fix-leak-when-updating-fstab-volumes %patch6 -p1 -b .udisks2-Fix-leaks-of-drive-icons-description +%patch7 -p1 -b .smb-Use-O_RDWR-to-fix-fstat-when-writing # Needed for gvfs-0.2.1-archive-integration.patch autoreconf -fi @@ -455,6 +459,12 @@ killall -USR1 gvfsd >&/dev/null || : %{_datadir}/installed-tests %changelog +* Thu Jun 23 2022 Ondrej Holy - 1.36.2-7 +- Fix unapplied patch (#2093816) + +* Tue Jun 14 2022 Ondrej Holy - 1.36.2-6 +- Use O_RDWR to fix fstat when writing on SMB share (#2093816) + * Fri Jul 2 2021 Ondrej Holy - 1.36.2-5 - Fix udisks2 volume monitor leaks (rhbz#1944813)