Compare commits
No commits in common. "imports/c8s/gvfs-1.36.2-8.el8" and "c8" have entirely different histories.
imports/c8
...
c8
164
SOURCES/goa-Add-support-for-certificate-prompts.patch
Normal file
164
SOURCES/goa-Add-support-for-certificate-prompts.patch
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
From bbc95d6716ac491489f059c68a6dd258e38aee79 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Ondrej Holy <oholy@redhat.com>
|
||||||
|
Date: Mon, 25 Nov 2019 16:53:31 +0100
|
||||||
|
Subject: [PATCH] goa: Add support for certificate prompts
|
||||||
|
|
||||||
|
Since commit f5ee590e, it is not possible to access Nextcloud/ownCloud
|
||||||
|
shares with self-signed (or invalid) certificates. This is because
|
||||||
|
the mount operation is handled by GOA volume monitor and the prompt
|
||||||
|
to accept certificate is not shown. Let's update the volume monitor
|
||||||
|
to handle just passwords and show the prompt to the client.
|
||||||
|
|
||||||
|
Fixes: https://gitlab.gnome.org/GNOME/gvfs/issues/251
|
||||||
|
---
|
||||||
|
monitor/goa/goavolume.c | 98 ++++++++++++++++++++++++++++++++++++++++-
|
||||||
|
1 file changed, 96 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/monitor/goa/goavolume.c b/monitor/goa/goavolume.c
|
||||||
|
index c077dd94..5e9097c6 100644
|
||||||
|
--- a/monitor/goa/goavolume.c
|
||||||
|
+++ b/monitor/goa/goavolume.c
|
||||||
|
@@ -64,6 +64,7 @@ G_DEFINE_TYPE_EXTENDED (GVfsGoaVolume, g_vfs_goa_volume, G_TYPE_OBJECT, 0,
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
GMountOperation *mount_operation;
|
||||||
|
+ GMountOperation *mount_operation_orig;
|
||||||
|
gchar *passwd;
|
||||||
|
} MountOp;
|
||||||
|
|
||||||
|
@@ -72,6 +73,13 @@ mount_op_free (MountOp *data)
|
||||||
|
{
|
||||||
|
g_clear_object (&data->mount_operation);
|
||||||
|
g_free (data->passwd);
|
||||||
|
+
|
||||||
|
+ if (data->mount_operation_orig != NULL)
|
||||||
|
+ {
|
||||||
|
+ g_signal_handlers_disconnect_by_data (data->mount_operation_orig, data);
|
||||||
|
+ g_object_unref (data->mount_operation_orig);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
g_slice_free (MountOp, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -97,6 +105,88 @@ account_attention_needed_cb (GObject *_object, GParamSpec *pspec, gpointer user_
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
+GType g_vfs_goa_mount_operation_get_type (void) G_GNUC_CONST;
|
||||||
|
+
|
||||||
|
+typedef struct
|
||||||
|
+{
|
||||||
|
+ GMountOperation parent_instance;
|
||||||
|
+} GVfsGoaMountOperation;
|
||||||
|
+
|
||||||
|
+typedef struct
|
||||||
|
+{
|
||||||
|
+ GMountOperationClass parent_class;
|
||||||
|
+} GVfsGoaMountOperationClass;
|
||||||
|
+
|
||||||
|
+static GMountOperation *
|
||||||
|
+g_vfs_goa_mount_operation_new (void)
|
||||||
|
+{
|
||||||
|
+ return G_MOUNT_OPERATION (g_object_new (g_vfs_goa_mount_operation_get_type (), NULL));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+G_DEFINE_TYPE (GVfsGoaMountOperation, g_vfs_goa_mount_operation, G_TYPE_MOUNT_OPERATION)
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+g_vfs_goa_mount_operation_init (GVfsGoaMountOperation *mount_operation)
|
||||||
|
+{
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+g_vfs_goa_mount_operation_ask_question (GMountOperation *op,
|
||||||
|
+ const char *message,
|
||||||
|
+ const char *choices[])
|
||||||
|
+{
|
||||||
|
+ /* This is needed to prevent G_MOUNT_OPERATION_UNHANDLED reply in idle. */
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+g_vfs_goa_mount_operation_class_init (GVfsGoaMountOperationClass *klass)
|
||||||
|
+{
|
||||||
|
+ GMountOperationClass *mount_op_class;
|
||||||
|
+
|
||||||
|
+ mount_op_class = G_MOUNT_OPERATION_CLASS (klass);
|
||||||
|
+ mount_op_class->ask_question = g_vfs_goa_mount_operation_ask_question;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* ---------------------------------------------------------------------------------------------------- */
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+ask_question_reply_cb (GMountOperation *op,
|
||||||
|
+ GMountOperationResult result,
|
||||||
|
+ gpointer user_data)
|
||||||
|
+{
|
||||||
|
+ MountOp *data = g_task_get_task_data (user_data);
|
||||||
|
+
|
||||||
|
+ g_mount_operation_set_choice (data->mount_operation,
|
||||||
|
+ g_mount_operation_get_choice (op));
|
||||||
|
+ g_mount_operation_reply (data->mount_operation, result);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+mount_operation_ask_question_cb (GMountOperation *op,
|
||||||
|
+ gchar *message,
|
||||||
|
+ GStrv choices,
|
||||||
|
+ gpointer user_data)
|
||||||
|
+{
|
||||||
|
+ MountOp *data = g_task_get_task_data (user_data);
|
||||||
|
+
|
||||||
|
+ if (data->mount_operation_orig != NULL)
|
||||||
|
+ {
|
||||||
|
+ g_signal_connect (data->mount_operation_orig,
|
||||||
|
+ "reply",
|
||||||
|
+ G_CALLBACK (ask_question_reply_cb),
|
||||||
|
+ user_data);
|
||||||
|
+ g_signal_emit_by_name (data->mount_operation_orig,
|
||||||
|
+ "ask-question",
|
||||||
|
+ message,
|
||||||
|
+ choices);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ g_mount_operation_reply (data->mount_operation,
|
||||||
|
+ G_MOUNT_OPERATION_UNHANDLED);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
mount_operation_ask_password_cb (GMountOperation *op,
|
||||||
|
gchar *message,
|
||||||
|
@@ -412,7 +502,7 @@ g_vfs_goa_volume_get_uuid (GVolume *_self)
|
||||||
|
static void
|
||||||
|
g_vfs_goa_volume_mount (GVolume *_self,
|
||||||
|
GMountMountFlags flags,
|
||||||
|
- GMountOperation *mount_operation,
|
||||||
|
+ GMountOperation *mount_operation_orig,
|
||||||
|
GCancellable *cancellable,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data)
|
||||||
|
@@ -423,6 +513,9 @@ g_vfs_goa_volume_mount (GVolume *_self,
|
||||||
|
GoaAccount *account;
|
||||||
|
|
||||||
|
data = g_slice_new0 (MountOp);
|
||||||
|
+ if (mount_operation_orig != NULL)
|
||||||
|
+ data->mount_operation_orig = g_object_ref (mount_operation_orig);
|
||||||
|
+
|
||||||
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_source_tag (task, g_vfs_goa_volume_mount);
|
||||||
|
g_task_set_task_data (task, data, (GDestroyNotify) mount_op_free);
|
||||||
|
@@ -431,8 +524,9 @@ g_vfs_goa_volume_mount (GVolume *_self,
|
||||||
|
* monitor because it is set up to emit MountOpAskPassword on
|
||||||
|
* ask-password.
|
||||||
|
*/
|
||||||
|
- data->mount_operation = g_mount_operation_new ();
|
||||||
|
+ data->mount_operation = g_vfs_goa_mount_operation_new ();
|
||||||
|
g_signal_connect (data->mount_operation, "ask-password", G_CALLBACK (mount_operation_ask_password_cb), task);
|
||||||
|
+ g_signal_connect (data->mount_operation, "ask-question", G_CALLBACK (mount_operation_ask_question_cb), task);
|
||||||
|
|
||||||
|
account = goa_object_peek_account (self->object);
|
||||||
|
goa_account_call_ensure_credentials (account, cancellable, ensure_credentials_cb, task);
|
||||||
|
--
|
||||||
|
2.28.0
|
||||||
|
|
2724
SOURCES/google-performance-fixes.patch
Normal file
2724
SOURCES/google-performance-fixes.patch
Normal file
File diff suppressed because it is too large
Load Diff
43
SOURCES/smb-Ignore-EINVAL-for-kerberos-login.patch
Normal file
43
SOURCES/smb-Ignore-EINVAL-for-kerberos-login.patch
Normal 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
|
||||||
|
|
115
SOURCES/smb-Improve-enumeration-performance.patch
Normal file
115
SOURCES/smb-Improve-enumeration-performance.patch
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index daeee728..689667e5 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -551,6 +551,11 @@ if test "x$enable_samba" != "xno"; then
|
||||||
|
AC_DEFINE(HAVE_SMBC_SETOPTIONPROTOCOLS, 1, [Define to 1 if smbc_setOptionProtocols() is available]),
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
+
|
||||||
|
+ AC_CHECK_LIB(smbclient, smbc_readdirplus2,
|
||||||
|
+ AC_DEFINE(HAVE_SMBC_READDIRPLUS2, 1, [Define to 1 if smbc_readdirplus2() is available]),
|
||||||
|
+ []
|
||||||
|
+ )
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
|
||||||
|
index 9571fa0d..ce151648 100644
|
||||||
|
--- a/daemon/gvfsbackendsmb.c
|
||||||
|
+++ b/daemon/gvfsbackendsmb.c
|
||||||
|
@@ -1738,25 +1738,34 @@ do_enumerate (GVfsBackend *backend,
|
||||||
|
GFileQueryInfoFlags flags)
|
||||||
|
{
|
||||||
|
GVfsBackendSmb *op_backend = G_VFS_BACKEND_SMB (backend);
|
||||||
|
- struct stat st;
|
||||||
|
- int res;
|
||||||
|
+ struct stat st = { 0 };
|
||||||
|
GError *error;
|
||||||
|
SMBCFILE *dir;
|
||||||
|
- char dirents[1024*4];
|
||||||
|
- struct smbc_dirent *dirp;
|
||||||
|
GFileInfo *info;
|
||||||
|
GString *uri;
|
||||||
|
- int uri_start_len;
|
||||||
|
smbc_opendir_fn smbc_opendir;
|
||||||
|
+ smbc_closedir_fn smbc_closedir;
|
||||||
|
+#ifndef HAVE_SMBC_READDIRPLUS2
|
||||||
|
+ int res;
|
||||||
|
+ char dirents[1024*4];
|
||||||
|
+ struct smbc_dirent *dirp;
|
||||||
|
+ int uri_start_len;
|
||||||
|
smbc_getdents_fn smbc_getdents;
|
||||||
|
smbc_stat_fn smbc_stat;
|
||||||
|
- smbc_closedir_fn smbc_closedir;
|
||||||
|
+#else
|
||||||
|
+ smbc_readdirplus2_fn smbc_readdirplus2;
|
||||||
|
+ const struct libsmb_file_info *exstat;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
uri = create_smb_uri_string (op_backend->server, op_backend->port, op_backend->share, filename);
|
||||||
|
|
||||||
|
smbc_opendir = smbc_getFunctionOpendir (op_backend->smb_context);
|
||||||
|
+#ifndef HAVE_SMBC_READDIRPLUS2
|
||||||
|
smbc_getdents = smbc_getFunctionGetdents (op_backend->smb_context);
|
||||||
|
smbc_stat = smbc_getFunctionStat (op_backend->smb_context);
|
||||||
|
+#else
|
||||||
|
+ smbc_readdirplus2 = smbc_getFunctionReaddirPlus2 (op_backend->smb_context);
|
||||||
|
+#endif
|
||||||
|
smbc_closedir = smbc_getFunctionClosedir (op_backend->smb_context);
|
||||||
|
|
||||||
|
dir = smbc_opendir (op_backend->smb_context, uri->str);
|
||||||
|
@@ -1776,6 +1785,8 @@ do_enumerate (GVfsBackend *backend,
|
||||||
|
|
||||||
|
if (uri->str[uri->len - 1] != '/')
|
||||||
|
g_string_append_c (uri, '/');
|
||||||
|
+
|
||||||
|
+#ifndef HAVE_SMBC_READDIRPLUS2
|
||||||
|
uri_start_len = uri->len;
|
||||||
|
|
||||||
|
while (TRUE)
|
||||||
|
@@ -1827,9 +1838,27 @@ do_enumerate (GVfsBackend *backend,
|
||||||
|
dirp = (struct smbc_dirent *) (((char *)dirp) + dirlen);
|
||||||
|
res -= dirlen;
|
||||||
|
}
|
||||||
|
+ }
|
||||||
|
+#else
|
||||||
|
+ while ((exstat = smbc_readdirplus2 (op_backend->smb_context, dir, &st)) != NULL)
|
||||||
|
+ {
|
||||||
|
+ if ((S_ISREG (st.st_mode) ||
|
||||||
|
+ S_ISDIR (st.st_mode) ||
|
||||||
|
+ S_ISLNK (st.st_mode)) &&
|
||||||
|
+ g_strcmp0 (exstat->name, ".") != 0 &&
|
||||||
|
+ g_strcmp0 (exstat->name, "..") != 0)
|
||||||
|
+ {
|
||||||
|
+ info = g_file_info_new ();
|
||||||
|
+ set_info_from_stat (op_backend, info, &st, exstat->name, matcher);
|
||||||
|
+ g_vfs_job_enumerate_add_info (job, info);
|
||||||
|
+ g_object_unref (info);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ memset (&st, 0, sizeof (struct stat));
|
||||||
|
}
|
||||||
|
-
|
||||||
|
- res = smbc_closedir (op_backend->smb_context, dir);
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+ smbc_closedir (op_backend->smb_context, dir);
|
||||||
|
|
||||||
|
g_vfs_job_enumerate_done (job);
|
||||||
|
|
||||||
|
diff --git a/meson.build b/meson.build
|
||||||
|
index 6ae768d9..d3f59457 100644
|
||||||
|
--- a/meson.build
|
||||||
|
+++ b/meson.build
|
||||||
|
@@ -418,6 +418,7 @@ if enable_samba
|
||||||
|
smbclient_dep = dependency('smbclient')
|
||||||
|
|
||||||
|
config_h.set('HAVE_SMBC_SETOPTIONPROTOCOLS', cc.has_function('smbc_setOptionProtocols', dependencies: smbclient_dep))
|
||||||
|
+ config_h.set('HAVE_SMBC_READDIRPLUS2', cc.has_function('smbc_readdirplus2', dependencies: smbclient_dep))
|
||||||
|
endif
|
||||||
|
|
||||||
|
# *** Check for libarchive ***
|
||||||
|
--
|
||||||
|
2.26.2
|
||||||
|
|
57
SOURCES/smb-Rework-anonymous-handling-to-avoid-EINVAL.patch
Normal file
57
SOURCES/smb-Rework-anonymous-handling-to-avoid-EINVAL.patch
Normal 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
|
||||||
|
|
67
SOURCES/smb-Use-O_RDWR-to-fix-fstat-when-writing.patch
Normal file
67
SOURCES/smb-Use-O_RDWR-to-fix-fstat-when-writing.patch
Normal 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
|
||||||
|
|
@ -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
|
||||||
|
|
55
SOURCES/trash-Sync-trash-dir-items-when-files-change.patch
Normal file
55
SOURCES/trash-Sync-trash-dir-items-when-files-change.patch
Normal 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
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
%global avahi_version 0.6
|
%global avahi_version 0.6
|
||||||
%global fuse_version 2.8.0
|
%global fuse_version 2.8.0
|
||||||
%global gettext_version 0.19.4
|
%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 goa_version 3.17.1
|
||||||
%global gsettings_desktop_schemas_version 3.28.1-2
|
%global gsettings_desktop_schemas_version 3.28.1-2
|
||||||
%global gudev_version 147
|
%global gudev_version 147
|
||||||
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
Name: gvfs
|
Name: gvfs
|
||||||
Version: 1.36.2
|
Version: 1.36.2
|
||||||
Release: 8%{?dist}
|
Release: 16%{?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
|
||||||
@ -60,6 +60,26 @@ Patch8: admin-Ensure-correct-ownership-when-moving-to-file-u.patch
|
|||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1759075
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1759075
|
||||||
Patch9: udisks2-Fix-crashes-caused-by-missing-source-tag.patch
|
Patch9: udisks2-Fix-crashes-caused-by-missing-source-tag.patch
|
||||||
|
|
||||||
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1569868
|
||||||
|
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
|
||||||
BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version}
|
BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version}
|
||||||
BuildRequires: pkgconfig(dbus-glib-1)
|
BuildRequires: pkgconfig(dbus-glib-1)
|
||||||
@ -161,7 +181,6 @@ Summary: gphoto2 support for gvfs
|
|||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
Requires: %{name}-client%{?_isa} = %{version}-%{release}
|
Requires: %{name}-client%{?_isa} = %{version}-%{release}
|
||||||
BuildRequires: pkgconfig(libgphoto2) >= %{libgphoto2_version}
|
BuildRequires: pkgconfig(libgphoto2) >= %{libgphoto2_version}
|
||||||
BuildRequires: libusb-devel >= %{libusb_version}
|
|
||||||
BuildRequires: libexif-devel
|
BuildRequires: libexif-devel
|
||||||
|
|
||||||
%description gphoto2
|
%description gphoto2
|
||||||
@ -204,6 +223,7 @@ Summary: MTP support for gvfs
|
|||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
Requires: %{name}-client%{?_isa} = %{version}-%{release}
|
Requires: %{name}-client%{?_isa} = %{version}-%{release}
|
||||||
BuildRequires: pkgconfig(libmtp) >= %{libmtp_version}
|
BuildRequires: pkgconfig(libmtp) >= %{libmtp_version}
|
||||||
|
BuildRequires: pkgconfig(libusb-1.0) >= %{libusb_version}
|
||||||
|
|
||||||
%description mtp
|
%description mtp
|
||||||
This package provides support for reading and writing files on
|
This package provides support for reading and writing files on
|
||||||
@ -346,9 +366,11 @@ killall -USR1 gvfsd >&/dev/null || :
|
|||||||
%{_libexecdir}/gvfsd-recent
|
%{_libexecdir}/gvfsd-recent
|
||||||
%{_mandir}/man1/gvfsd.1*
|
%{_mandir}/man1/gvfsd.1*
|
||||||
%{_mandir}/man1/gvfsd-metadata.1*
|
%{_mandir}/man1/gvfsd-metadata.1*
|
||||||
|
%if ! 0%{?flatpak}
|
||||||
%{_userunitdir}/gvfs-daemon.service
|
%{_userunitdir}/gvfs-daemon.service
|
||||||
%{_userunitdir}/gvfs-metadata.service
|
%{_userunitdir}/gvfs-metadata.service
|
||||||
%{_userunitdir}/gvfs-udisks2-volume-monitor.service
|
%{_userunitdir}/gvfs-udisks2-volume-monitor.service
|
||||||
|
%endif
|
||||||
|
|
||||||
%files client -f gvfs.lang
|
%files client -f gvfs.lang
|
||||||
%{!?_licensedir:%global license %%doc}
|
%{!?_licensedir:%global license %%doc}
|
||||||
@ -370,7 +392,9 @@ killall -USR1 gvfsd >&/dev/null || :
|
|||||||
%files fuse
|
%files fuse
|
||||||
%{_libexecdir}/gvfsd-fuse
|
%{_libexecdir}/gvfsd-fuse
|
||||||
%{_mandir}/man1/gvfsd-fuse.1*
|
%{_mandir}/man1/gvfsd-fuse.1*
|
||||||
|
%if ! 0%{?flatpak}
|
||||||
%{_tmpfilesdir}/gvfsd-fuse-tmpfiles.conf
|
%{_tmpfilesdir}/gvfsd-fuse-tmpfiles.conf
|
||||||
|
%endif
|
||||||
|
|
||||||
%files smb
|
%files smb
|
||||||
%{_libexecdir}/gvfsd-smb
|
%{_libexecdir}/gvfsd-smb
|
||||||
@ -390,7 +414,9 @@ killall -USR1 gvfsd >&/dev/null || :
|
|||||||
%{_libexecdir}/gvfs-gphoto2-volume-monitor
|
%{_libexecdir}/gvfs-gphoto2-volume-monitor
|
||||||
%{_datadir}/dbus-1/services/org.gtk.vfs.GPhoto2VolumeMonitor.service
|
%{_datadir}/dbus-1/services/org.gtk.vfs.GPhoto2VolumeMonitor.service
|
||||||
%{_datadir}/gvfs/remote-volume-monitors/gphoto2.monitor
|
%{_datadir}/gvfs/remote-volume-monitors/gphoto2.monitor
|
||||||
|
%if ! 0%{?flatpak}
|
||||||
%{_userunitdir}/gvfs-gphoto2-volume-monitor.service
|
%{_userunitdir}/gvfs-gphoto2-volume-monitor.service
|
||||||
|
%endif
|
||||||
|
|
||||||
%ifnarch s390 s390x
|
%ifnarch s390 s390x
|
||||||
%files afc
|
%files afc
|
||||||
@ -399,8 +425,10 @@ killall -USR1 gvfsd >&/dev/null || :
|
|||||||
%{_libexecdir}/gvfs-afc-volume-monitor
|
%{_libexecdir}/gvfs-afc-volume-monitor
|
||||||
%{_datadir}/dbus-1/services/org.gtk.vfs.AfcVolumeMonitor.service
|
%{_datadir}/dbus-1/services/org.gtk.vfs.AfcVolumeMonitor.service
|
||||||
%{_datadir}/gvfs/remote-volume-monitors/afc.monitor
|
%{_datadir}/gvfs/remote-volume-monitors/afc.monitor
|
||||||
|
%if ! 0%{?flatpak}
|
||||||
%{_userunitdir}/gvfs-afc-volume-monitor.service
|
%{_userunitdir}/gvfs-afc-volume-monitor.service
|
||||||
%endif
|
%endif
|
||||||
|
%endif
|
||||||
|
|
||||||
%files afp
|
%files afp
|
||||||
%{_libexecdir}/gvfsd-afp
|
%{_libexecdir}/gvfsd-afp
|
||||||
@ -414,7 +442,9 @@ killall -USR1 gvfsd >&/dev/null || :
|
|||||||
%{_libexecdir}/gvfs-mtp-volume-monitor
|
%{_libexecdir}/gvfs-mtp-volume-monitor
|
||||||
%{_datadir}/dbus-1/services/org.gtk.vfs.MTPVolumeMonitor.service
|
%{_datadir}/dbus-1/services/org.gtk.vfs.MTPVolumeMonitor.service
|
||||||
%{_datadir}/gvfs/remote-volume-monitors/mtp.monitor
|
%{_datadir}/gvfs/remote-volume-monitors/mtp.monitor
|
||||||
|
%if ! 0%{?flatpak}
|
||||||
%{_userunitdir}/gvfs-mtp-volume-monitor.service
|
%{_userunitdir}/gvfs-mtp-volume-monitor.service
|
||||||
|
%endif
|
||||||
|
|
||||||
%if ! 0%{?rhel}
|
%if ! 0%{?rhel}
|
||||||
%files nfs
|
%files nfs
|
||||||
@ -430,7 +460,9 @@ killall -USR1 gvfsd >&/dev/null || :
|
|||||||
%{_datadir}/gvfs/remote-volume-monitors/goa.monitor
|
%{_datadir}/gvfs/remote-volume-monitors/goa.monitor
|
||||||
%{_datadir}/gvfs/mounts/google.mount
|
%{_datadir}/gvfs/mounts/google.mount
|
||||||
%{_libexecdir}/gvfsd-google
|
%{_libexecdir}/gvfsd-google
|
||||||
|
%if ! 0%{?flatpak}
|
||||||
%{_userunitdir}/gvfs-goa-volume-monitor.service
|
%{_userunitdir}/gvfs-goa-volume-monitor.service
|
||||||
|
%endif
|
||||||
|
|
||||||
%files tests
|
%files tests
|
||||||
%dir %{_libexecdir}/installed-tests
|
%dir %{_libexecdir}/installed-tests
|
||||||
@ -438,6 +470,30 @@ killall -USR1 gvfsd >&/dev/null || :
|
|||||||
%{_datadir}/installed-tests
|
%{_datadir}/installed-tests
|
||||||
|
|
||||||
%changelog
|
%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)
|
||||||
|
|
||||||
|
* Wed Aug 05 2020 Ondrej Holy <oholy@redhat.com> - 1.36.2-10
|
||||||
|
- Fix libusb(x) requirements (rhbz#1866332)
|
||||||
|
|
||||||
|
* Wed Jun 17 2020 Ondrej Holy <oholy@redhat.com> - 1.36.2-9
|
||||||
|
- Improve enumeration performance of smb backend (rhbz#1569868)
|
||||||
|
|
||||||
* Tue Oct 8 2019 Ondrej Holy <oholy@redhat.com> - 1.36.2-8
|
* Tue Oct 8 2019 Ondrej Holy <oholy@redhat.com> - 1.36.2-8
|
||||||
- Fix udisks2 volume monitor crashes when stopping drive (rhbz#1759075)
|
- Fix udisks2 volume monitor crashes when stopping drive (rhbz#1759075)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user