Hello community, here is the log from the commit of package ibus for openSUSE:Leap:15.2 checked in at 2020-01-30 14:50:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/ibus (Old) and /work/SRC/openSUSE:Leap:15.2/.ibus.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ibus" Thu Jan 30 14:50:23 2020 rev:29 rq:761560 version:1.5.21 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/ibus/ibus.changes 2020-01-15 15:11:46.286118693 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.ibus.new.26092/ibus.changes 2020-01-30 14:51:30.638937893 +0100 @@ -2 +2 @@ -Wed Sep 11 13:11:22 UTC 2019 - Cliff Zhao <qz...@suse.com> +Fri Sep 20 05:31:52 UTC 2019 - Cliff Zhao <qz...@suse.com> @@ -4,3 +4,90 @@ -- Add ibus-CVE-2019-14822.patch: Fix misconfiguration of the DBus - server allows to unprivileged user could monitor and send method - calls to the ibus bus of another user(CVE-2019-14822 bnc#1150011). +- Update hide-setup-menu.patch: make it can be compile in SLE + (openSUSE-Leap 15). + +------------------------------------------------------------------- +Tue Sep 17 21:51:08 UTC 2019 - Bjørn Lie <bjorn....@gmail.com> + +- Add ibus-CVE-2019-14822-GDBusServer-peer-authorization.patch: + bus: Implement GDBusAuthObserver callback, fix CVE-2019-14822. + +------------------------------------------------------------------- +Thu Sep 5 13:17:58 UTC 2019 - Fuminobu Takeyama <ft...@geeko.jp> + +- Apply the change on Jun. 22 again, reverted by the previous + change +- Stop exporting OOO_FORCE_DESKTOP (boo#1042136) + * KDE4 LibreOffice VCL plugin was removed from upstream + * New KDE5/Qt5 VCL plugin supporting Qt IM Module will be + available + * Note only LibreOffice KDE5/Qt5 >= 6.3 supports Qt IM module + - For older version, please export OOO_FORCE_DESKTOP=gnome + in ~/.profile + +------------------------------------------------------------------- +Thu Aug 29 16:22:00 UTC 2019 - Fuminobu Takeyama <ft...@geeko.jp> + +- Upstream update to 1.5.21 + * Enable to run ibus-setup with a different python + * Update ibusunicodegen.h for Unicode UCD 12.0 + * Add ibus.its for IME's component files + * Make ISO 639 language names with title + * Keep preedit cursor_pos and visible in clearing preedit text + * Support long sequences and multiple output characters for + compose table + - fix boo#1138123 + * Exit ibus-daemon with parent's death + * Update Wayland input-method protocol to unstable v1 + * Indistinguishable address of ibus-daemon + * Update LOCALES_STRING + * Fix typos +- Drop ibus-fix-check-abs-icon-path-support.patch + * not necessary anymore since the current Qt is enough new + +------------------------------------------------------------------- +Sat Jun 22 13:13:33 UTC 2019 - Fuminobu Takeyama <ft...@geeko.jp> + +- Stop exporting OOO_FORCE_DESKTOP (boo#1042136) + * KDE4 LibreOffice VCL plugin was removed from upstream + * New KDE5/Qt5 VCL plugin supporting Qt IM Module will be + available + +------------------------------------------------------------------- +Wed May 8 09:40:05 UTC 2019 - Dominique Leuenberger <dims...@opensuse.org> + +- Move RPM macros to %_rpmmacrodir. + +------------------------------------------------------------------- +Mon Mar 4 15:48:52 UTC 2019 - Fuminobu Takeyama <ft...@geeko.jp> + +- Fix boo#1127711 + * Remove nodejs-emojione form BuildRequires + +------------------------------------------------------------------- +Sat Mar 2 07:19:12 UTC 2019 - Fuminobu Takeyama <ft...@geeko.jp> + +- Upstream update to 1.5.20 + * Support Shift-Space to insert a Space on Emojier preedit + * Do not add emojis in compose category to emoji variants + * Implement mouse click with Hangul in ibus side + * Delete Gconf dependencies and migrate intool to gettext + * Do not delete IBUS_CAP_SURROUNDING_TEXT + * Show compose preedit with custom compose file + * Fix Atom and Slack for Flatpak + * Delete Super-space notification + * Use ISO 639-3 to have names for more languages + * introspection: Tell the GI scanner to include the C headers + * Add Uzbek layouts + * Allow using non-abstract UNIX domain sockets + * Fix minor build problems, bugs, and typos + +------------------------------------------------------------------- +Mon Feb 25 15:33:01 UTC 2019 - ft...@geeko.jp + +- Fix boo#1126011: fix unexpected LibreOffice's dependency on IBus + * Remove "Supplements" for libreoffice-gnome + +------------------------------------------------------------------- +Tue Sep 18 09:04:44 UTC 2018 - sch...@suse.de + +- Disable emoji support on armv6l, ppc and riscv64, which have no nodejs + support --- /work/SRC/openSUSE:Leap:15.2/ibus/python-ibus.changes 2020-01-15 15:11:46.406118760 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.ibus.new.26092/python-ibus.changes 2020-01-30 14:51:30.678937914 +0100 @@ -1,0 +2,12 @@ +Thu Aug 29 16:22:00 UTC 2019 - Fuminobu Takeyama <ft...@geeko.jp> + +- Update version to 1.5.21 + * No update for this subpackage + +------------------------------------------------------------------- +Mon Mar 4 15:58:26 UTC 2019 - Fuminobu Takeyama <ft...@geeko.jp> + +- Update version to 1.5.20 + * No update for this subpackage + +------------------------------------------------------------------- Old: ---- ibus-1.5.19.tar.gz ibus-CVE-2019-14822.patch ibus-fix-check-abs-icon-path-support.patch New: ---- ibus-1.5.21.tar.gz ibus-CVE-2019-14822-GDBusServer-peer-authorization.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ibus.spec ++++++ --- /var/tmp/diff_new_pack.6tqvJL/_old 2020-01-30 14:51:31.266938226 +0100 +++ /var/tmp/diff_new_pack.6tqvJL/_new 2020-01-30 14:51:31.266938226 +0100 @@ -1,7 +1,7 @@ # # spec file for package ibus # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,26 +12,30 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %if 0%{?is_opensuse} %define with_wayland 1 %define with_kde 1 +%ifarch armv6l armv6hl ppc riscv64 +%define with_emoji 0 +%else %define with_emoji 1 +%endif %else %define with_wayland 0 %define with_kde 0 %define with_emoji 0 %endif Name: ibus -Version: 1.5.19 +Version: 1.5.21 Release: 0 Summary: The "Intelligent Input Bus" input method License: LGPL-2.1-or-later Group: System/I18n/Chinese -Url: https://github.com/ibus/ +URL: https://github.com/ibus/ Source: https://github.com/ibus/ibus/releases/download/%{version}/%{name}-%{version}.tar.gz Source2: README.SUSE Source3: xim.ibus.suse.template @@ -47,8 +51,6 @@ # PATCH-FIX-UPSTREAM ft...@geeko.jp # Select an IM engine at the first login Patch8: im-engines-precede-xkb.patch -# PATCH-FIX-UPSTREAM ft...@geeko.jp -Patch9: ibus-fix-check-abs-icon-path-support.patch # PATCH-FIX-SLE hide-setup-menu.patch bnc#899259 qz...@suse.com # ibus-setup should not launch from main menu. Patch10: hide-setup-menu.patch @@ -58,9 +60,9 @@ # PATCH-FIX-SLE ibus-disable-engines-preload-in-GNOME.patch bnc#1036729 qz...@suse.com # Disable ibus engines preload in GNOME for These works are handled by gnome-shell. Patch12: ibus-disable-engines-preload-in-GNOME.patch -# PATCH-FIX-SLE ibus-CVE-2019-14822.patch CVE-2019-14822 bnc#1150011 qz...@suse.com -# Fix the misconfiguration of the DBus server allows to unprivileged user could monitor and send method calls to the ibus bus of another user. -Patch13: ibus-CVE-2019-14822.patch + +Patch13: ibus-CVE-2019-14822-GDBusServer-peer-authorization.patch + BuildRequires: dbus-1-glib-devel BuildRequires: dconf-devel >= 0.7.5 BuildRequires: fdupes @@ -69,7 +71,6 @@ BuildRequires: gobject-introspection-devel >= 0.9.6 BuildRequires: gtk-doc >= 1.9 BuildRequires: gtk2-devel -BuildRequires: intltool BuildRequires: iso-codes-devel BuildRequires: libnotify-devel >= 0.7 BuildRequires: libtool @@ -97,7 +98,6 @@ # versions to 3.0 only. Requires: typelib-1_0-Gtk-3_0 Recommends: %{name}-lang -Supplements: packageand(libreoffice:libreoffice-gnome) Provides: locale(ja;ko;zh) Obsoletes: ibus-gnome-shell %if %{with_kde} @@ -107,7 +107,6 @@ BuildRequires: pkgconfig(wayland-client) >= 1.2.0 %endif %if %{with_emoji} -BuildRequires: nodejs-emojione BuildRequires: unicode-emoji BuildRequires: pkgconfig(cldr-emoji-annotation) %endif @@ -180,7 +179,6 @@ %patch0 -p1 %patch4 -p1 %patch8 -p1 -%patch9 -p1 cp -r %{SOURCE2} . cp -r %{SOURCE3} . @@ -199,7 +197,6 @@ %build autoreconf -fi -intltoolize -f %configure --disable-static \ --enable-gtk3 \ --enable-vala \ @@ -264,10 +261,10 @@ touch %{buildroot}/%{_sysconfdir}/dconf/db/ibus # install macros -mkdir -p %{buildroot}%{_sysconfdir}/rpm -install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/rpm +mkdir -p %{buildroot}%{_rpmmacrodir} +install -m 644 %{SOURCE7} %{buildroot}%{_rpmmacrodir} -%suse_update_desktop_file -r %{name}-setup Settings DesktopSettings X-SuSE-Core-System +%suse_update_desktop_file -r org.freedesktop.IBus.Setup Settings DesktopSettings X-SuSE-Core-System %fdupes %{buildroot} @@ -300,14 +297,14 @@ %files %doc AUTHORS README README.SUSE xim.ibus.suse.template %license COPYING -%config %{_sysconfdir}/rpm/macros.ibus +%{_rpmmacrodir}/macros.ibus %config %{_sysconfdir}/X11/xim.d/* %{_bindir}/ibus %{_bindir}/ibus-autostart %{_bindir}/ibus-daemon %{_bindir}/ibus-setup %{_datadir}/ibus/ -%{_datadir}/applications/ibus-setup.desktop +%{_datadir}/applications/org.freedesktop.IBus.Setup.desktop %{_datadir}/GConf/gsettings/ibus.convert %{_datadir}/glib-2.0/schemas/org.freedesktop.ibus.gschema.xml %{_datadir}/icons/hicolor/*/apps/ibus*.* @@ -356,6 +353,7 @@ %{_includedir}/ibus-1.0 %{_datadir}/gtk-doc/html/ibus %{_libdir}/pkgconfig/ibus-1.0.pc +%{_datadir}/gettext/its/ibus.* %{_datadir}/gir-1.0/IBus-1.0.gir %{_datadir}/vala/vapi/ibus-1.0.deps %{_datadir}/vala/vapi/ibus-1.0.vapi ++++++ python-ibus.spec ++++++ --- /var/tmp/diff_new_pack.6tqvJL/_old 2020-01-30 14:51:31.286938237 +0100 +++ /var/tmp/diff_new_pack.6tqvJL/_new 2020-01-30 14:51:31.286938237 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-ibus # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -12,19 +12,18 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # %define _name ibus - Name: python-ibus -Version: 1.5.19 +Version: 1.5.21 Release: 0 Summary: Python2 module for ibus License: LGPL-2.1-or-later Group: System/I18n/Chinese -Url: https://github.com/ibus/ +URL: https://github.com/ibus/ Source: https://github.com/ibus/ibus/releases/download/%{version}/%{_name}-%{version}.tar.gz # Source: %{_name}-%{version}.tar.gz # PATCH-FIX-OPENSUSE ibus-python-install-dir.patch ft...@geeko.jp @@ -42,22 +41,21 @@ BuildRequires: iso-codes-devel BuildRequires: libnotify-devel >= 0.7 BuildRequires: libtool -BuildRequires: pkg-config +BuildRequires: pkgconfig BuildRequires: python BuildRequires: python-devel BuildRequires: python-gobject-devel BuildRequires: unicode-ucd BuildRequires: update-desktop-files +# copy_deep method is supported since 0.31.1 +BuildRequires: vala >= 0.31.1 BuildRequires: x11-tools BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(json-glib-1.0) BuildRequires: pkgconfig(vapigen) BuildRequires: pkgconfig(xkbcommon) -# copy_deep method is supported since 0.31.1 -BuildRequires: vala >= 0.31.1 Requires: %{_name} = %{version} Requires: python-gobject -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description IBus, short for Intelligent Input Bus, is an input framework. IBus @@ -71,7 +69,6 @@ %build autoreconf -fi -intltoolize -f %configure --disable-static \ --enable-gtk3 \ --enable-vala \ ++++++ hide-setup-menu.patch ++++++ --- /var/tmp/diff_new_pack.6tqvJL/_old 2020-01-30 14:51:31.322938256 +0100 +++ /var/tmp/diff_new_pack.6tqvJL/_new 2020-01-30 14:51:31.322938256 +0100 @@ -1,6 +1,6 @@ -diff -Nura ibus-1.5.8_old/setup/ibus-setup.desktop.in ibus-1.5.8_new/setup/ibus-setup.desktop.in ---- ibus-1.5.8_old/setup/ibus-setup.desktop.in 2014-07-24 12:24:25.000000000 +0800 -+++ ibus-1.5.8_new/setup/ibus-setup.desktop.in 2015-10-15 19:12:16.476328652 +0800 +diff -Nura ibus-1.5.21/setup/ibus-setup.desktop ibus-1.5.21_new/setup/ibus-setup.desktop +--- ibus-1.5.21/setup/ibus-setup.desktop 2019-08-23 13:08:34.000000000 +0200 ++++ ibus-1.5.21_new/setup/ibus-setup.desktop 2019-09-20 07:21:33.505022653 +0200 @@ -4,6 +4,7 @@ Exec=ibus-setup Icon=ibus-setup ++++++ ibus-1.5.19.tar.gz -> ibus-1.5.21.tar.gz ++++++ ++++ 340092 lines of diff (skipped) ++++++ ibus-CVE-2019-14822-GDBusServer-peer-authorization.patch ++++++ >From 3d442dbf936d197aa11ca0a71663c2bc61696151 Mon Sep 17 00:00:00 2001 From: fujiwarat <takao.fujiwa...@gmail.com> Date: Fri, 13 Sep 2019 15:59:03 +0900 Subject: [PATCH] bus: Implement GDBusAuthObserver callback ibus uses a GDBusServer with G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS, and doesn't set a GDBusAuthObserver, which allows anyone who can connect to its AF_UNIX socket to authenticate and be authorized to send method calls. It also seems to use an abstract AF_UNIX socket, which does not have filesystem permissions, so the practical effect might be that a local attacker can connect to another user's ibus service and make arbitrary method calls. BUGS=rhbz#1717958 --- bus/server.c | 89 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 16 deletions(-) diff --git a/bus/server.c b/bus/server.c index 3a626230..2439de14 100644 --- a/bus/server.c +++ b/bus/server.c @@ -2,7 +2,8 @@ /* vim:set et sts=4: */ /* bus - The Input Bus * Copyright (C) 2008-2010 Peng Huang <shawn.p.hu...@gmail.com> - * Copyright (C) 2008-2010 Red Hat, Inc. + * Copyright (C) 2011-2019 Takao Fujiwara <takao.fujiwa...@gmail.com> + * Copyright (C) 2008-2019 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -69,17 +70,64 @@ _restart_server (void) exit (-1); } +/** + * bus_allow_mechanism_cb: + * @observer: A #GDBusAuthObserver. + * @mechanism: The name of the mechanism. + * @user_data: always %NULL. + * + * Check if @mechanism can be used to authenticate the other peer. + * Returns: %TRUE if the peer's mechanism is allowed. + */ +static gboolean +bus_allow_mechanism_cb (GDBusAuthObserver *observer, + const gchar *mechanism, + G_GNUC_UNUSED gpointer user_data) +{ + if (g_strcmp0 (mechanism, "EXTERNAL") == 0) + return TRUE; + return FALSE; +} + +/** + * bus_authorize_authenticated_peer_cb: + * @observer: A #GDBusAuthObserver. + * @stream: A #GIOStream. + * @credentials: A #GCredentials. + * @user_data: always %NULL. + * + * Check if a peer who has already authenticated should be authorized. + * Returns: %TRUE if the peer's credential is authorized. + */ +static gboolean +bus_authorize_authenticated_peer_cb (GDBusAuthObserver *observer, + GIOStream *stream, + GCredentials *credentials, + G_GNUC_UNUSED gpointer user_data) +{ + gboolean authorized = FALSE; + if (credentials) { + GCredentials *own_credentials = g_credentials_new (); + if (g_credentials_is_same_user (credentials, own_credentials, NULL)) + authorized = TRUE; + g_object_unref (own_credentials); + } + return authorized; +} + /** * bus_new_connection_cb: - * @user_data: always NULL. - * @returns: TRUE when the function can handle the connection. + * @observer: A #GDBusAuthObserver. + * @dbus_connection: A #GDBusconnection. + * @user_data: always %NULL. * * Handle incoming connections. + * Returns: %TRUE when the function can handle the connection. */ static gboolean -bus_new_connection_cb (GDBusServer *server, - GDBusConnection *dbus_connection, - gpointer user_data) +bus_new_connection_cb (GDBusServer *server, + GDBusConnection *dbus_connection, + G_GNUC_UNUSED gpointer user_data) { BusConnection *connection = bus_connection_new (dbus_connection); bus_dbus_impl_new_connection (dbus, connection); @@ -94,9 +142,9 @@ bus_new_connection_cb (GDBusServer *server, } static void -_server_connect_start_portal_cb (GObject *source_object, - GAsyncResult *res, - gpointer user_data) +_server_connect_start_portal_cb (GObject *source_object, + GAsyncResult *res, + G_GNUC_UNUSED gpointer user_data) { GVariant *result; GError *error = NULL; @@ -113,9 +161,9 @@ _server_connect_start_portal_cb (GObject *source_object, } static void -bus_acquired_handler (GDBusConnection *connection, - const gchar *name, - gpointer user_data) +bus_acquired_handler (GDBusConnection *connection, + const gchar *name, + G_GNUC_UNUSED gpointer user_data) { g_dbus_connection_call (connection, IBUS_SERVICE_PORTAL, @@ -136,14 +184,17 @@ void bus_server_init (void) { GError *error = NULL; + GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_NONE; + gchar *guid; + GDBusAuthObserver *observer; dbus = bus_dbus_impl_get_default (); ibus = bus_ibus_impl_get_default (); bus_dbus_impl_register_object (dbus, (IBusService *)ibus); /* init server */ - GDBusServerFlags flags = G_DBUS_SERVER_FLAGS_AUTHENTICATION_ALLOW_ANONYMOUS; - gchar *guid = g_dbus_generate_guid (); + guid = g_dbus_generate_guid (); + observer = g_dbus_auth_observer_new (); if (!g_str_has_prefix (g_address, "unix:tmpdir=") && !g_str_has_prefix (g_address, "unix:path=")) { g_error ("Your socket address does not have the format unix:tmpdir=$DIR " @@ -152,7 +203,7 @@ bus_server_init (void) server = g_dbus_server_new_sync ( g_address, /* the place where the socket file lives, e.g. /tmp, abstract namespace, etc. */ flags, guid, - NULL /* observer */, + observer, NULL /* cancellable */, &error); if (server == NULL) { @@ -162,7 +213,13 @@ bus_server_init (void) } g_free (guid); - g_signal_connect (server, "new-connection", G_CALLBACK (bus_new_connection_cb), NULL); + g_signal_connect (observer, "allow-mechanism", + G_CALLBACK (bus_allow_mechanism_cb), NULL); + g_signal_connect (observer, "authorize-authenticated-peer", + G_CALLBACK (bus_authorize_authenticated_peer_cb), NULL); + g_object_unref (observer); + g_signal_connect (server, "new-connection", + G_CALLBACK (bus_new_connection_cb), NULL); g_dbus_server_start (server); -- 2.21.0 >From 018a0f889d18c41e314f0b1297d1dc559603142b Mon Sep 17 00:00:00 2001 From: fujiwarat <takao.fujiwa...@gmail.com> Date: Tue, 5 Feb 2019 18:36:04 +0900 Subject: [PATCH] Fix SEGV in bus_panel_proxy_focus_in() rhbz#1349148, rhbz#1385349 SEGV in BUS_IS_PANEL_PROXY() in bus_panel_proxy_focus_in() Check if GDBusConnect is closed before bus_panel_proxy_new() is called. rhbz#1350291 SEGV in BUS_IS_CONNECTION(skip_connection) in bus_dbus_impl_dispatch_message_by_rule() check if dbus_connection is closed in bus_dbus_impl_connection_filter_cb(). rhbz#1406699 SEGV in new_owner!=NULL in bus_dbus_impl_name_owner_changed() which is called by bus_name_service_remove_owner() If bus_connection_get_unique_name()==NULL, set new_owner="" in bus_name_service_remove_owner() rhbz#1432252 SEGV in old_owner!=NULL in bus_dbus_impl_name_owner_changed() which is called by bus_name_service_set_primary_owner() If bus_connection_get_unique_name()==NULL, set old_owner="" in bus_name_service_set_primary_owner() rhbz#1601577 SEGV in ibus_engine_desc_get_layout() in bus_engine_proxy_new_internal() WIP: Added a GError to get the error message to check why the SEGV happened. rhbz#1663528 SEGV in g_mutex_clear() in bus_dbus_impl_destroy() If the mutex is not unlocked, g_mutex_clear() causes assert. BUG=rhbz#1349148 BUG=rhbz#1385349 BUG=rhbz#1350291 BUG=rhbz#1406699 BUG=rhbz#1432252 BUG=rhbz#1601577 BUG=rhbz#1663528 --- bus/dbusimpl.c | 70 +++++++++++++++++++++++++++++++++++++++++------ bus/engineproxy.c | 9 +++++- bus/ibusimpl.c | 21 ++++++++++++-- 3 files changed, 88 insertions(+), 12 deletions(-) diff --git a/bus/dbusimpl.c b/bus/dbusimpl.c index b54ef817..fb38faf0 100644 --- a/bus/dbusimpl.c +++ b/bus/dbusimpl.c @@ -2,7 +2,8 @@ /* vim:set et sts=4: */ /* ibus - The Input Bus * Copyright (C) 2008-2013 Peng Huang <shawn.p.hu...@gmail.com> - * Copyright (C) 2008-2013 Red Hat, Inc. + * Copyright (C) 2015-2019 Takao Fujiwara <takao.fujiwa...@gmail.com> + * Copyright (C) 2008-2019 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -344,6 +345,8 @@ bus_name_service_set_primary_owner (BusNameService *service, BusConnectionOwner *owner, BusDBusImpl *dbus) { + gboolean has_old_owner = FALSE; + g_assert (service != NULL); g_assert (owner != NULL); g_assert (dbus != NULL); @@ -351,6 +354,13 @@ bus_name_service_set_primary_owner (BusNameService *service, BusConnectionOwner *old = service->owners != NULL ? (BusConnectionOwner *)service->owners->data : NULL; + /* rhbz#1432252 If bus_connection_get_unique_name() == NULL, + * "Hello" method is not received yet. + */ + if (old != NULL && bus_connection_get_unique_name (old->conn) != NULL) { + has_old_owner = TRUE; + } + if (old != NULL) { g_signal_emit (dbus, dbus_signals[NAME_LOST], @@ -370,7 +380,8 @@ bus_name_service_set_primary_owner (BusNameService *service, 0, owner->conn, service->name, - old != NULL ? bus_connection_get_unique_name (old->conn) : "", + has_old_owner ? bus_connection_get_unique_name (old->conn) : + "", bus_connection_get_unique_name (owner->conn)); if (old != NULL && old->do_not_queue != 0) { @@ -427,6 +438,7 @@ bus_name_service_remove_owner (BusNameService *service, BusDBusImpl *dbus) { GSList *owners; + gboolean has_new_owner = FALSE; g_assert (service != NULL); g_assert (owner != NULL); @@ -439,6 +451,13 @@ bus_name_service_remove_owner (BusNameService *service, BusConnectionOwner *_new = NULL; if (owners->next != NULL) { _new = (BusConnectionOwner *)owners->next->data; + /* rhbz#1406699 If bus_connection_get_unique_name() == NULL, + * "Hello" method is not received yet. + */ + if (_new != NULL && + bus_connection_get_unique_name (_new->conn) != NULL) { + has_new_owner = TRUE; + } } if (dbus != NULL) { @@ -447,7 +466,7 @@ bus_name_service_remove_owner (BusNameService *service, 0, owner->conn, service->name); - if (_new != NULL) { + if (has_new_owner) { g_signal_emit (dbus, dbus_signals[NAME_ACQUIRED], 0, @@ -460,7 +479,7 @@ bus_name_service_remove_owner (BusNameService *service, _new != NULL ? _new->conn : NULL, service->name, bus_connection_get_unique_name (owner->conn), - _new != NULL ? bus_connection_get_unique_name (_new->conn) : ""); + has_new_owner ? bus_connection_get_unique_name (_new->conn) : ""); } } @@ -591,6 +610,7 @@ static void bus_dbus_impl_destroy (BusDBusImpl *dbus) { GList *p; + int i; for (p = dbus->objects; p != NULL; p = p->next) { IBusService *object = (IBusService *) p->data; @@ -628,12 +648,39 @@ bus_dbus_impl_destroy (BusDBusImpl *dbus) dbus->unique_names = NULL; dbus->names = NULL; + for (i = 0; g_idle_remove_by_data (dbus); i++) { + if (i > 1000) { + g_warning ("Too many idle threads were generated by " \ + "bus_dbus_impl_forward_message_idle_cb and " \ + "bus_dbus_impl_dispatch_message_by_rule_idle_cb"); + break; + } + } g_list_free_full (dbus->start_service_calls, (GDestroyNotify) bus_method_call_free); dbus->start_service_calls = NULL; - g_mutex_clear (&dbus->dispatch_lock); - g_mutex_clear (&dbus->forward_lock); + /* rhbz#1663528 Call g_mutex_trylock() before g_mutex_clear() + * because if the mutex is not unlocked, g_mutex_clear() causes assert. + */ +#define BUS_DBUS_MUTEX_SAFE_CLEAR(mtex) { \ + int count = 0; \ + while (!g_mutex_trylock ((mtex))) { \ + g_usleep (1); \ + if (count > 60) { \ + g_warning (#mtex " is dead lock"); \ + break; \ + } \ + ++count; \ + } \ + g_mutex_unlock ((mtex)); \ + g_mutex_clear ((mtex)); \ +} + + BUS_DBUS_MUTEX_SAFE_CLEAR (&dbus->dispatch_lock); + BUS_DBUS_MUTEX_SAFE_CLEAR (&dbus->forward_lock); + +#undef BUS_DBUS_MUTEX_SAFE_CLEAR /* FIXME destruct _lock and _queue members. */ IBUS_OBJECT_CLASS(bus_dbus_impl_parent_class)->destroy ((IBusObject *) dbus); @@ -1464,13 +1511,20 @@ bus_dbus_impl_connection_filter_cb (GDBusConnection *dbus_connection, gboolean incoming, gpointer user_data) { + BusDBusImpl *dbus; + BusConnection *connection; + g_assert (G_IS_DBUS_CONNECTION (dbus_connection)); g_assert (G_IS_DBUS_MESSAGE (message)); g_assert (BUS_IS_DBUS_IMPL (user_data)); - BusDBusImpl *dbus = (BusDBusImpl *) user_data; - BusConnection *connection = bus_connection_lookup (dbus_connection); + if (g_dbus_connection_is_closed (dbus_connection)) + return NULL; + + dbus = (BusDBusImpl *) user_data; + connection = bus_connection_lookup (dbus_connection); g_assert (connection != NULL); + g_assert (BUS_IS_CONNECTION (connection)); if (incoming) { /* is incoming message */ diff --git a/bus/engineproxy.c b/bus/engineproxy.c index 2d98995c..2176e0c9 100644 --- a/bus/engineproxy.c +++ b/bus/engineproxy.c @@ -665,6 +665,7 @@ bus_engine_proxy_new_internal (const gchar *path, IBusEngineDesc *desc, GDBusConnection *connection) { + GError *error = NULL; g_assert (path); g_assert (IBUS_IS_ENGINE_DESC (desc)); g_assert (G_IS_DBUS_CONNECTION (connection)); @@ -673,7 +674,7 @@ bus_engine_proxy_new_internal (const gchar *path, BusEngineProxy *engine = (BusEngineProxy *) g_initable_new (BUS_TYPE_ENGINE_PROXY, NULL, - NULL, + &error, "desc", desc, "g-connection", connection, "g-interface-name", IBUS_INTERFACE_ENGINE, @@ -681,6 +682,12 @@ bus_engine_proxy_new_internal (const gchar *path, "g-default-timeout", g_gdbus_timeout, "g-flags", flags, NULL); + /* FIXME: rhbz#1601577 */ + if (error) { + /* show abrt local variable */ + gchar *message = g_strdup (error->message); + g_error ("%s", message); + } const gchar *layout = ibus_engine_desc_get_layout (desc); if (layout != NULL && layout[0] != '\0') { engine->keymap = ibus_keymap_get (layout); diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c index bbbb5770..77fcf42f 100644 --- a/bus/ibusimpl.c +++ b/bus/ibusimpl.c @@ -464,13 +464,16 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, else if (!g_strcmp0 (name, IBUS_SERVICE_PANEL_EXTENSION_EMOJI)) panel_type = PANEL_TYPE_EXTENSION_EMOJI; - if (panel_type != PANEL_TYPE_NONE) { + do { + if (panel_type == PANEL_TYPE_NONE) + break; if (g_strcmp0 (new_name, "") != 0) { /* a Panel process is started. */ BusConnection *connection; BusInputContext *context = NULL; BusPanelProxy **panel = (panel_type == PANEL_TYPE_PANEL) ? &ibus->panel : &ibus->emoji_extension; + GDBusConnection *dbus_connection = NULL; if (*panel != NULL) { ibus_proxy_destroy ((IBusProxy *)(*panel)); @@ -479,9 +482,21 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, g_assert (*panel == NULL); } - connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, new_name); + connection = bus_dbus_impl_get_connection_by_name (BUS_DEFAULT_DBUS, + new_name); g_return_if_fail (connection != NULL); + dbus_connection = bus_connection_get_dbus_connection (connection); + /* rhbz#1349148 rhbz#1385349 + * Avoid SEGV of BUS_IS_PANEL_PROXY (ibus->panel) + * This function is called during destroying the connection + * in this case? */ + if (dbus_connection == NULL || + g_dbus_connection_is_closed (dbus_connection)) { + new_name = ""; + break; + } + *panel = bus_panel_proxy_new (connection, panel_type); if (panel_type == PANEL_TYPE_EXTENSION_EMOJI) ibus->enable_emoji_extension = FALSE; @@ -535,7 +550,7 @@ _dbus_name_owner_changed_cb (BusDBusImpl *dbus, } } } - } + } while (0); bus_ibus_impl_component_name_owner_changed (ibus, name, old_name, new_name); } -- 2.20.1 ++++++ xim.d-ibus-121 ++++++ --- /var/tmp/diff_new_pack.6tqvJL/_old 2020-01-30 14:51:32.150938696 +0100 +++ /var/tmp/diff_new_pack.6tqvJL/_new 2020-01-30 14:51:32.154938699 +0100 @@ -30,17 +30,6 @@ ;; esac -# Force OOo to use gtk-immodule -# Only libreoffice-gnome supports IM module -# To fix cursor following problem (on_the_spot), do not use libreoffice-kde4 -if [ -e /usr/lib64/libreoffice/program/libvclplug_gtklo.so ] || - [ -e /usr/lib/libreoffice/program/libvclplug_gtklo.so ] || - [ -e /usr/lib64/libreoffice/program/libvclplug_gtk3lo.so ] || - [ -e /usr/lib/libreoffice/program/libvclplug_gtk3lo.so ]; then - export OOO_FORCE_DESKTOP=gnome -else - echo "libreoffice-gnome is not found. For better IBus support, please install libreoffice-gnome" -fi export XMODIFIERS="@im=ibus" export GTK_IM_MODULE=ibus