Apply patches on new upstream 1.50.3

This commit is contained in:
Yue-Lan 2023-04-07 11:43:24 +08:00
parent e461fe9c1e
commit b4a44fd4f1
12 changed files with 0 additions and 660 deletions

View File

@ -1,29 +0,0 @@
From: Sebastien Bacher <seb128@ubuntu.com>
Date: Mon, 19 Mar 2018 15:51:12 +0000
Subject: Skip the umockdev test
The trace is out of date & needs to be re-recorded by somebody who has
the hardware.
Origin: vendor, Ubuntu
Bug-Upstream: https://bugzilla.gnome.org/show_bug.cgi?id=794488
---
test/gvfs-test | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/test/gvfs-test b/test/gvfs-test
index 3038923..5fc335b 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -1725,8 +1725,9 @@ class Trash(GvfsTestCase):
self.assertTrue(os.path.exists(self.my_file))
-@unittest.skipUnless(have_umockdev,
- 'umockdev not installed; get it from https://launchpad.net/umockdev')
+#@unittest.skipUnless(have_umockdev,
+# 'umockdev not installed; get it from https://launchpad.net/umockdev')
+@unittest.skip("umockdev/ioctl recording is currently known to have issue and not to be reworked")
class GPhoto(GvfsTestCase):
def test_mount_api(self):
'''gphoto2:// mount with Gio API'''

View File

@ -1,45 +0,0 @@
From: Iain Lane <iain@orangesquash.org.uk>
Date: Mon, 19 Mar 2018 15:25:17 +0000
Subject: gvfs-test: Increase timeout to 10s
In normal operation some operations - particularly unmounting - can take
quite a while. Let's give things a bit longer before giving up.
Patch originally by Andreas Hasenack <andreas.hasenack@canonical.com>
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=794487
---
test/gvfs-test | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/gvfs-test b/test/gvfs-test
index 5fc335b..c689b9a 100755
--- a/test/gvfs-test
+++ b/test/gvfs-test
@@ -176,7 +176,7 @@ class GvfsTestCase(unittest.TestCase):
def unmount(self, uri):
self.program_out_success(['gio', 'mount', '-u', uri])
- timeout = 5
+ timeout = 10
while timeout > 0:
(out, err) = self.program_out_err(['gio', 'mount', '-li'])
if not re.search('Mount.*' + uri, out):
@@ -265,7 +265,7 @@ class GvfsTestCase(unittest.TestCase):
def unmount_api(self, gfile):
'''Umount a mounted Gio.File using the Gio API
- This times out after 5 seconds.
+ This times out after 10 seconds.
'''
self.cb_result = None
@@ -282,7 +282,7 @@ class GvfsTestCase(unittest.TestCase):
mount.unmount_with_operation(Gio.MountUnmountFlags.NONE, None, None,
unmount_done, ml)
# ensure we are timing out
- GLib.timeout_add_seconds(5, lambda data: ml.quit(), None)
+ GLib.timeout_add_seconds(10, lambda data: ml.quit(), None)
ml.run()
self.assertNotEqual(self.cb_result, None, 'operation timed out')

View File

@ -1,24 +0,0 @@
From: Laurent Bigonville <bigon@debian.org>
Date: Tue, 8 Nov 2016 19:44:47 +0100
Subject: Use sudo group instead of the wheel one
since the wheel group doesn't exist on Debian
Forwarded: not-needed
---
daemon/org.gtk.vfs.file-operations.rules | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/org.gtk.vfs.file-operations.rules b/daemon/org.gtk.vfs.file-operations.rules
index 6e528e9..e71656f 100644
--- a/daemon/org.gtk.vfs.file-operations.rules
+++ b/daemon/org.gtk.vfs.file-operations.rules
@@ -7,7 +7,7 @@ polkit.addRule(function(action, subject) {
if ((action.id == "org.gtk.vfs.file-operations-helper") &&
subject.local &&
subject.active &&
- subject.isInGroup ("wheel")) {
+ subject.isInGroup ("sudo")) {
return polkit.Result.YES;
}
});

View File

@ -1,25 +0,0 @@
From: Simon McVittie <smcv@debian.org>
Date: Fri, 17 Aug 2018 08:55:33 +0100
Subject: Remove version from polkit-gobject dependency
It was versioned like this to require the polkit ITS rules, but in
Debian we backported those into 0.105.
Forwarded: not-needed, Debian-specific
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index aea0fd1..4d120a9 100644
--- a/meson.build
+++ b/meson.build
@@ -302,7 +302,7 @@ config_h.set('HAVE_GCR', enable_gcr)
enable_admin = get_option('admin')
if enable_admin
libcap_dep = dependency('libcap')
- polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.114')
+ polkit_gobject_dep = dependency('polkit-gobject-1')
endif
# *** Check if we should build with http backend ***

View File

@ -1,296 +0,0 @@
From: Iain Lane <laney@debian.org>
Date: Wed, 21 Aug 2019 12:16:10 +0100
Subject: Revert "fuse: Adapt gvfsd-fuse to use fuse 3.x"
This reverts commit 7a0a06186b6fef07b8fce2360c04fd075fc84ed1.
In Ubuntu we have fuse 2 in main and fuse 3 in universe. We'll need to
work out a transition plan to switch.
Forwarded: not-needed
---
client/gvfsfusedaemon.c | 114 ++++++++++++++----------------------------------
daemon/main.c | 4 +-
meson.build | 2 +-
3 files changed, 37 insertions(+), 83 deletions(-)
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 037a249..2aa6bf5 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -43,8 +43,7 @@
#include <gvfsdbus.h>
#include <gvfsutils.h>
-#define FUSE_USE_VERSION 30
-
+#define FUSE_USE_VERSION 26
#include <fuse.h>
#include <fuse_lowlevel.h>
@@ -860,7 +859,7 @@ getattr_for_file_handle (FileHandle *fh, struct stat *sbuf)
}
static gint
-vfs_getattr (const gchar *path, struct stat *sbuf, struct fuse_file_info *fi)
+vfs_getattr (const gchar *path, struct stat *sbuf)
{
GFile *file;
gint result = 0;
@@ -1582,12 +1581,12 @@ readdir_for_file (GFile *base_file, gpointer buf, fuse_fill_dir_t filler)
return result;
}
- filler (buf, ".", NULL, 0, 0);
- filler (buf, "..", NULL, 0, 0);
+ filler (buf, ".", NULL, 0);
+ filler (buf, "..", NULL, 0);
while ((file_info = g_file_enumerator_next_file (enumerator, NULL, &error)) != NULL)
{
- filler (buf, g_file_info_get_name (file_info), NULL, 0, 0);
+ filler (buf, g_file_info_get_name (file_info), NULL, 0);
g_object_unref (file_info);
}
@@ -1598,7 +1597,7 @@ readdir_for_file (GFile *base_file, gpointer buf, fuse_fill_dir_t filler)
static gint
vfs_readdir (const gchar *path, gpointer buf, fuse_fill_dir_t filler, off_t offset,
- struct fuse_file_info *fi, enum fuse_readdir_flags fl)
+ struct fuse_file_info *fi)
{
GFile *base_file;
gint result = 0;
@@ -1611,8 +1610,8 @@ vfs_readdir (const gchar *path, gpointer buf, fuse_fill_dir_t filler, off_t offs
/* Mount list */
- filler (buf, ".", NULL, 0, 0);
- filler (buf, "..", NULL, 0, 0);
+ filler (buf, ".", NULL, 0);
+ filler (buf, "..", NULL, 0);
mount_list_lock ();
@@ -1620,7 +1619,7 @@ vfs_readdir (const gchar *path, gpointer buf, fuse_fill_dir_t filler, off_t offs
{
MountRecord *mount_record = l->data;
- filler (buf, mount_record->name, NULL, 0, 0);
+ filler (buf, mount_record->name, NULL, 0);
}
mount_list_unlock ();
@@ -1644,21 +1643,13 @@ vfs_readdir (const gchar *path, gpointer buf, fuse_fill_dir_t filler, off_t offs
}
static gint
-vfs_rename (const gchar *old_path, const gchar *new_path, unsigned int vfs_flags)
+vfs_rename (const gchar *old_path, const gchar *new_path)
{
GFile *old_file;
GFile *new_file;
- GFileCopyFlags flags = G_FILE_COPY_OVERWRITE;
GError *error = NULL;
gint result = 0;
- /* Can not implement this flag because limitation of GFile. */
- if (vfs_flags & RENAME_EXCHANGE)
- return -EINVAL;
-
- if (vfs_flags & RENAME_NOREPLACE)
- flags = G_FILE_COPY_NONE;
-
g_debug ("vfs_rename: %s -> %s\n", old_path, new_path);
old_file = file_from_full_path (old_path);
@@ -1674,7 +1665,7 @@ vfs_rename (const gchar *old_path, const gchar *new_path, unsigned int vfs_flags
file_handle_close_stream (fh);
}
- g_file_move (old_file, new_file, flags, NULL, NULL, NULL, &error);
+ g_file_move (old_file, new_file, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error);
if (error)
{
@@ -2081,15 +2072,6 @@ vfs_truncate (const gchar *path, off_t size)
return result;
}
-static gint
-vfs_truncate_dispatch (const gchar *path, off_t size, struct fuse_file_info *fi)
-{
- if (fi)
- return vfs_ftruncate (path, size, fi);
-
- return vfs_truncate (path, size);
-}
-
static gint
vfs_symlink (const gchar *path_old, const gchar *path_new)
{
@@ -2196,7 +2178,7 @@ vfs_access (const gchar *path, gint mode)
}
static gint
-vfs_utimens (const gchar *path, const struct timespec tv [2], struct fuse_file_info *fi)
+vfs_utimens (const gchar *path, const struct timespec tv [2])
{
GFile *file;
GError *error = NULL;
@@ -2271,7 +2253,7 @@ vfs_utimens (const gchar *path, const struct timespec tv [2], struct fuse_file_i
}
static gint
-vfs_chmod (const gchar *path, mode_t mode, struct fuse_file_info *fi)
+vfs_chmod (const gchar *path, mode_t mode)
{
GFile *file;
GError *error = NULL;
@@ -2394,7 +2376,7 @@ register_fuse_cb (GVfsDBusMountTracker *proxy,
}
static gpointer
-vfs_init (struct fuse_conn_info *conn, struct fuse_config *cfg)
+vfs_init (struct fuse_conn_info *conn)
{
GVfsDBusMountTracker *proxy;
GError *error;
@@ -2470,7 +2452,7 @@ vfs_init (struct fuse_conn_info *conn, struct fuse_config *cfg)
conn->want |= FUSE_CAP_ATOMIC_O_TRUNC;
/* Prevent out-of-order readahead */
- conn->want &= ~FUSE_CAP_ASYNC_READ;
+ conn->async_read = 0;
/* Use up to a 64KiB write block size. Only has an effect if -o big_writes
* is given on the command-line. */
@@ -2521,7 +2503,8 @@ static struct fuse_operations vfs_oper =
.unlink = vfs_unlink,
.mkdir = vfs_mkdir,
.rmdir = vfs_rmdir,
- .truncate = vfs_truncate_dispatch,
+ .ftruncate = vfs_ftruncate,
+ .truncate = vfs_truncate,
.symlink = vfs_symlink,
.access = vfs_access,
.utimens = vfs_utimens,
@@ -2533,7 +2516,6 @@ static struct fuse_operations vfs_oper =
.getxattr = vfs_getxattr,
.listxattr = vfs_listxattr,
.removexattr = vfs_removexattr,
- .ftruncate = vfs_ftruncate,
#endif
};
@@ -2555,65 +2537,35 @@ gint
main (gint argc, gchar *argv [])
{
struct fuse *fuse;
+ struct fuse_chan *ch;
struct fuse_session *se;
+ char *mountpoint;
+ int multithreaded;
int res;
- struct fuse_cmdline_opts opts;
- struct fuse_args args = FUSE_ARGS_INIT (argc, argv);
-
- if (fuse_opt_parse (&args, NULL, NULL, NULL) == -1)
- return 1;
-
- if (fuse_parse_cmdline (&args, &opts) != 0)
- return 1;
-
- if (opts.show_version)
- {
- printf ("%s\n", PACKAGE_STRING);
- fuse_lowlevel_version ();
- return 0;
- }
-
- if (opts.show_help)
- {
- printf ("usage: %s [options] <mountpoint>\n\n", argv[0]);
- printf ("FUSE options:\n");
- fuse_cmdline_help ();
- return 0;
- }
-
- if (!opts.mountpoint)
- {
- fprintf (stderr, "error: no mountpoint specified\n");
- return 1;
- }
- fuse = fuse_new (&args, &vfs_oper, sizeof (vfs_oper), NULL /* user data */);
+ fuse = fuse_setup (argc, argv, &vfs_oper, sizeof (vfs_oper), &mountpoint,
+ &multithreaded, NULL /* user data */);
if (fuse == NULL)
return 1;
- if (fuse_mount (fuse, opts.mountpoint) != 0)
- return 1;
-
- if (fuse_daemonize (opts.foreground) != 0)
- return 1;
+ if (multithreaded)
+ res = fuse_loop_mt (fuse);
+ else
+ res = fuse_loop (fuse);
se = fuse_get_session (fuse);
- if (fuse_set_signal_handlers (se) != 0)
- return 1;
-
- if (opts.singlethread)
- res = fuse_loop (fuse);
- else
- res = fuse_loop_mt (fuse, opts.clone_fd);
+ ch = fuse_session_next_chan (se, NULL);
/* Ignore new signals during exit procedure in order to terminate properly */
set_custom_signal_handlers (SIG_IGN);
fuse_remove_signal_handlers (se);
- fuse_unmount (fuse);
+ fuse_unmount (mountpoint, ch);
fuse_destroy (fuse);
- free (opts.mountpoint);
- fuse_opt_free_args (&args);
+ free (mountpoint);
- return res;
+ if (res == -1)
+ return 1;
+
+ return 0;
}
diff --git a/daemon/main.c b/daemon/main.c
index d145c5f..dca9039 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -96,7 +96,9 @@ on_name_acquired (GDBusConnection *connection,
argv2[0] = LIBEXEC_DIR "/gvfsd-fuse";
argv2[1] = fuse_path;
argv2[2] = "-f";
- argv2[3] = NULL;
+ argv2[3] = "-o";
+ argv2[4] = "big_writes";
+ argv2[5] = NULL;
g_spawn_async (NULL,
argv2,
diff --git a/meson.build b/meson.build
index 4d120a9..38c5c24 100644
--- a/meson.build
+++ b/meson.build
@@ -330,7 +330,7 @@ config_h.set('HAVE_GUDEV', enable_gudev)
# *** Check for FUSE ***
enable_fuse = get_option('fuse')
if enable_fuse
- fuse_dep = dependency('fuse3', version: '>= 3.0.0')
+ fuse_dep = dependency('fuse', version: '>= 2.8.0')
endif
config_h.set('HAVE_FUSE', enable_fuse)

View File

@ -1,29 +0,0 @@
From: Iain Lane <laney@debian.org>
Date: Wed, 21 Aug 2019 12:15:05 +0100
Subject: Revert "fuse: Remove max_write limit"
This reverts commit b4047cdfe316d624e5cb1d83d165d25339775a72.
In Ubuntu we have fuse 2 in main and fuse 3 in universe. We'll need to
work out a transition plan to switch.
Forwarded: not-needed
---
client/gvfsfusedaemon.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index e203850..037a249 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -2472,6 +2472,10 @@ vfs_init (struct fuse_conn_info *conn, struct fuse_config *cfg)
/* Prevent out-of-order readahead */
conn->want &= ~FUSE_CAP_ASYNC_READ;
+ /* Use up to a 64KiB write block size. Only has an effect if -o big_writes
+ * is given on the command-line. */
+ conn->max_write = 65536;
+
return NULL;
}

View File

@ -1,33 +0,0 @@
From: Debian GNOME Maintainers
<pkg-gnome-maintainers@lists.alioth.debian.org>
Date: Wed, 29 Jun 2022 08:33:47 +0000
Subject: backport-gvfd-trash-deadlock
===================================================================
---
daemon/trashlib/dirwatch.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/daemon/trashlib/dirwatch.c b/daemon/trashlib/dirwatch.c
index f2bc692..3d32d32 100644
--- a/daemon/trashlib/dirwatch.c
+++ b/daemon/trashlib/dirwatch.c
@@ -216,6 +216,7 @@ dir_watch_recursive_destroy (gpointer user_data)
watch->state = FALSE;
}
+ g_file_monitor_cancel (watch->parent_monitor);
g_object_unref (watch->parent_monitor);
watch->parent_monitor = NULL;
}
@@ -271,7 +272,10 @@ dir_watch_free (DirWatch *watch)
if (watch != NULL)
{
if (watch->parent_monitor)
+ {
+ g_file_monitor_cancel (watch->parent_monitor);
g_object_unref (watch->parent_monitor);
+ }
g_object_unref (watch->directory);
g_object_unref (watch->topdir);

View File

@ -1,33 +0,0 @@
From: Michael Terry <mterry@ubuntu.com>
Date: Wed, 11 Apr 2012 16:01:32 -0400
Subject: Don't try to announce the finish of a NULL job.
Origin: vendor, Ubuntu
Bug-Ubuntu: LP #345754, #838464
---
daemon/gvfschannel.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/daemon/gvfschannel.c b/daemon/gvfschannel.c
index cc07988..c0c26da 100644
--- a/daemon/gvfschannel.c
+++ b/daemon/gvfschannel.c
@@ -612,7 +612,8 @@ send_reply_cb (GObject *source_object,
job = channel->priv->current_job;
channel->priv->current_job = NULL;
- g_vfs_job_emit_finished (job);
+ if (job)
+ g_vfs_job_emit_finished (job);
class = G_VFS_CHANNEL_GET_CLASS (channel);
@@ -633,7 +634,7 @@ send_reply_cb (GObject *source_object,
}
/* Start queued request or readahead */
else if (!start_queued_request (channel) &&
- class->readahead)
+ class->readahead && job)
{
/* No queued requests, maybe we want to do a readahead call */
channel->priv->current_job = class->readahead (channel, job);

View File

@ -1,25 +0,0 @@
From: Michael Terry <mterry@ubuntu.com>
Date: Wed, 11 Apr 2012 16:01:32 -0400
Subject: Don't crash when creating volume monitors
if the VFS was never initialized
Origin: vendor, Ubuntu
Bug-Ubuntu: LP #832533
---
client/gdaemonvfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index bae13eb..e3fbd8a 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -1434,7 +1434,7 @@ g_daemon_vfs_deserialize_icon (GVfs *vfs,
GDBusConnection *
_g_daemon_vfs_get_async_bus (void)
{
- return the_vfs->async_bus;
+ return the_vfs ? the_vfs->async_bus : NULL;
}
static gboolean

View File

@ -1,29 +0,0 @@
From: Christian Kellner <gicmo@gnome.org>
Date: Wed, 4 Nov 2009 16:40:24 +0100
Subject: Nuke the metadata file if magic blob is wrong
---
metadata/metatree.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/metadata/metatree.c b/metadata/metatree.c
index 0c11ddc..fa7697d 100644
--- a/metadata/metatree.c
+++ b/metadata/metatree.c
@@ -451,7 +451,15 @@ meta_tree_init (MetaTree *tree)
if (memcmp (tree->header->magic, MAGIC, MAGIC_LEN) != 0)
{
g_warning ("can't init metadata tree %s: wrong magic", tree->filename);
- goto err;
+ if (!tree->for_write)
+ goto err;
+
+ meta_tree_clear (tree);
+
+ if (g_unlink (tree->filename) != 0)
+ goto err;
+
+ goto retry;
}
if (tree->header->major != MAJOR_VERSION)

View File

@ -1,72 +0,0 @@
From: Michael Terry <mterry@ubuntu.com>
Date: Thu, 12 Apr 2012 15:14:55 -0400
Subject: make sure to keep a ref to jobs while they run in a thread
Origin: vendor, Ubuntu
---
daemon/gvfschannel.c | 5 +++--
daemon/gvfsdaemon.c | 7 +++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/daemon/gvfschannel.c b/daemon/gvfschannel.c
index c0c26da..fa490f6 100644
--- a/daemon/gvfschannel.c
+++ b/daemon/gvfschannel.c
@@ -644,6 +644,7 @@ send_reply_cb (GObject *source_object,
}
g_object_unref (job);
+ g_object_unref (channel);
}
/* Might be called on an i/o thread */
@@ -667,7 +668,7 @@ g_vfs_channel_send_reply (GVfsChannel *channel,
channel->priv->reply_buffer,
G_VFS_DAEMON_SOCKET_PROTOCOL_REPLY_SIZE,
0, NULL,
- send_reply_cb, channel);
+ send_reply_cb, g_object_ref (channel));
}
else
{
@@ -676,7 +677,7 @@ g_vfs_channel_send_reply (GVfsChannel *channel,
channel->priv->output_data,
channel->priv->output_data_size,
0, NULL,
- send_reply_cb, channel);
+ send_reply_cb, g_object_ref (channel));
}
}
diff --git a/daemon/gvfsdaemon.c b/daemon/gvfsdaemon.c
index 0946f41..e35d7f7 100644
--- a/daemon/gvfsdaemon.c
+++ b/daemon/gvfsdaemon.c
@@ -209,6 +209,7 @@ job_handler_callback (gpointer data,
GVfsJob *job = G_VFS_JOB (data);
g_vfs_job_run (job);
+ g_object_unref (job);
}
static void
@@ -648,7 +649,8 @@ g_vfs_daemon_queue_job (GVfsDaemon *daemon,
if (!g_vfs_job_try (job))
{
/* Couldn't finish / run async, queue worker thread */
- g_thread_pool_push (daemon->thread_pool, job, NULL); /* TODO: Check error */
+ if (!g_thread_pool_push (daemon->thread_pool, g_object_ref (job), NULL)) /* TODO: Check error */
+ g_object_unref (job);
}
}
@@ -1169,7 +1171,8 @@ void
g_vfs_daemon_run_job_in_thread (GVfsDaemon *daemon,
GVfsJob *job)
{
- g_thread_pool_push (daemon->thread_pool, job, NULL); /* TODO: Check error */
+ if (!g_thread_pool_push (daemon->thread_pool, g_object_ref (job), NULL)) /* TODO: Check error */
+ g_object_unref (job);
}
void

View File

@ -1,20 +0,0 @@
From: cckylin-cibot <cckylin-cibot@kylinos.cn>
Date: Wed, 29 Jun 2022 12:59:34 +0000
Subject: update debian/changelog.
---
daemon/meson.build | 1 -
1 file changed, 1 deletion(-)
diff --git a/daemon/meson.build b/daemon/meson.build
index dffeef3..bdc506f 100644
--- a/daemon/meson.build
+++ b/daemon/meson.build
@@ -366,7 +366,6 @@ if enable_admin
)
i18n.merge_file(
- policy,
input: policy_in,
output: '@BASENAME@',
po_dir: po_dir,