From 77441e61adc4879816b5f85a73509419d306e383 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Tue, 3 Sep 2024 10:28:19 +0200 Subject: [PATCH] Imported Upstream version 2.80.2 --- NEWS | 20 ++++++++++++++++++++ docs/reference/glib/meson.build | 2 +- gio/gdbusconnection.c | 10 ++++++++-- gio/tests/gdbus-connection.c | 29 +++++++++++++++++------------ meson.build | 2 +- 5 files changed, 47 insertions(+), 16 deletions(-) diff --git a/NEWS b/NEWS index 0ab2454..d0693e3 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,23 @@ +Overview of changes in GLib 2.80.2, 2024-05-08 +============================================== + +* Fix a regression with IBus caused by the fix for CVE-2024-34397 (#3353, + work by Simon McVittie) + +* Fix installation directory of the GVariant specification (#3351, work by + Michael Catanzaro) + +* Bugs fixed: + - #3351 GVariant specification installed in wrong directory (Michael + Catanzaro) + - #3353 Fixing CVE-2024-34397 caused regressions for ibus (Simon McVittie) + - !4052 Backport "gdbusconnection: Fix test signal subscription ordering" to + glib-2-80 + - !4054 Backport !4049 “Correct installation directory of GVariant + specification” to glib-2-80 + - !4055 Backport !4053 “gdbusconnection: Allow name owners to have the syntax + of a well-known name” to glib-2-80 + Overview of changes in GLib 2.80.1, 2024-05-07 ============================================== diff --git a/docs/reference/glib/meson.build b/docs/reference/glib/meson.build index e5e6726..47c5ecf 100644 --- a/docs/reference/glib/meson.build +++ b/docs/reference/glib/meson.build @@ -23,7 +23,7 @@ if get_option('documentation') rst2html5 = find_program('rst2html5', 'rst2html5.py', required: false) if rst2html5.found() - spec_path = docs_dir + spec_path = docs_dir / 'glib-2.0' figures = files( 'gvariant-byte-boundaries.svg', diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c index a543df9..4c1d2e2 100644 --- a/gio/gdbusconnection.c +++ b/gio/gdbusconnection.c @@ -2380,7 +2380,10 @@ name_watcher_deliver_name_owner_changed_unlocked (SignalData *name_watcher, /* Our caller already checked this */ g_assert (g_strcmp0 (name_watcher->arg0, name) == 0); - if (G_LIKELY (new_owner[0] == '\0' || g_dbus_is_unique_name (new_owner))) + /* FIXME: This should be validating that `new_owner` is a unique name, + * but IBus’ implementation of a message bus is not compliant with the spec. + * See https://gitlab.gnome.org/GNOME/glib/-/issues/3353 */ + if (G_LIKELY (new_owner[0] == '\0' || g_dbus_is_name (new_owner))) name_watcher_set_name_owner_unlocked (name_watcher, new_owner); else g_warning ("Received NameOwnerChanged signal with invalid owner \"%s\" for \"%s\"", @@ -2432,7 +2435,10 @@ name_watcher_deliver_get_name_owner_reply_unlocked (SignalData *name_watcher, g_variant_get (body, "(&s)", &new_owner); - if (G_LIKELY (g_dbus_is_unique_name (new_owner))) + /* FIXME: This should be validating that `new_owner` is a unique name, + * but IBus’ implementation of a message bus is not compliant with the spec. + * See https://gitlab.gnome.org/GNOME/glib/-/issues/3353 */ + if (G_LIKELY (g_dbus_is_name (new_owner))) name_watcher_set_name_owner_unlocked (name_watcher, new_owner); else g_warning ("Received GetNameOwner reply with invalid owner \"%s\" for \"%s\"", diff --git a/gio/tests/gdbus-connection.c b/gio/tests/gdbus-connection.c index 95d2b84..fc88167 100644 --- a/gio/tests/gdbus-connection.c +++ b/gio/tests/gdbus-connection.c @@ -536,7 +536,12 @@ test_connection_signal_handler (GDBusConnection *connection, interface_name, signal_name);*/ - g_main_loop_quit (loop); + /* We defer quitting to a G_PRIORITY_DEFAULT_IDLE function so other queued signal + * callbacks have a chance to run first. They get dispatched with a higher priority + * of G_PIORITY_DEFAULT, so as long as the queue is non-empty g_main_loop_quit won't + * run + */ + g_idle_add_once ((GSourceOnceFunc) g_main_loop_quit, loop); } static void @@ -627,7 +632,7 @@ test_connection_signals (void) "org.gtk.GDBus.ExampleInterface", /* interface */ "FooArg0", /* member */ "/org/gtk/GDBus/ExampleInterface", /* path */ - "some-arg0", + NULL, G_DBUS_SIGNAL_FLAGS_NONE, test_connection_signal_handler, &count_s4, @@ -637,7 +642,7 @@ test_connection_signals (void) "org.gtk.GDBus.ExampleInterface", /* interface */ "FooArg0", /* member */ "/org/gtk/GDBus/ExampleInterface", /* path */ - NULL, + "some-arg0", G_DBUS_SIGNAL_FLAGS_NONE, test_connection_signal_handler, &count_s5, @@ -741,8 +746,8 @@ test_connection_signals (void) g_assert_cmpint (count_s2, ==, 2); /* Emit another signal on c2 with and without arg0 set, to check matching on that. - * Matching should fail on s4 when the signal is not emitted with an arg0. It - * should succeed on s5 both times, as that doesn’t require an arg0 match. */ + * Matching should fail on s5 when the signal is not emitted with an arg0. It + * should succeed on s4 both times, as that doesn’t require an arg0 match. */ ret = g_dbus_connection_emit_signal (c2, NULL, /* destination bus name */ "/org/gtk/GDBus/ExampleInterface", @@ -753,9 +758,9 @@ test_connection_signals (void) g_assert_no_error (error); g_assert_true (ret); - while (count_s5 < 1) + while (count_s4 < 1) g_main_loop_run (loop); - g_assert_cmpint (count_s5, ==, 1); + g_assert_cmpint (count_s4, ==, 1); ret = g_dbus_connection_emit_signal (c2, NULL, /* destination bus name */ @@ -767,10 +772,10 @@ test_connection_signals (void) g_assert_no_error (error); g_assert_true (ret); - while (count_s4 < 1) + while (count_s5 < 1) g_main_loop_run (loop); - g_assert_cmpint (count_s4, ==, 1); - g_assert_cmpint (count_s5, ==, 2); + g_assert_cmpint (count_s4, ==, 2); + g_assert_cmpint (count_s5, ==, 1); /* * Also to check the total amount of NameOwnerChanged signals - use a 5 second ceiling @@ -784,8 +789,8 @@ test_connection_signals (void) g_assert_cmpint (count_s1, ==, 1); g_assert_cmpint (count_s2, ==, 2); g_assert_cmpint (count_name_owner_changed, ==, 2); - g_assert_cmpint (count_s4, ==, 1); - g_assert_cmpint (count_s5, ==, 2); + g_assert_cmpint (count_s4, ==, 2); + g_assert_cmpint (count_s5, ==, 1); g_dbus_connection_signal_unsubscribe (c1, s1); g_dbus_connection_signal_unsubscribe (c1, s2); diff --git a/meson.build b/meson.build index 55094c7..b995ebc 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('glib', 'c', - version : '2.80.1', + version : '2.80.2', # NOTE: See the policy in docs/meson-version.md before changing the Meson dependency meson_version : '>= 1.2.0', default_options : [ -- 2.7.4