From c5b4e55b4d0e05a352ec400b67c50bbabffa289a Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 4 Jan 2019 09:14:35 +0100 Subject: [PATCH] Backport a patch to fix gnome-shell crashes with glib 2.59 --- ...Fix-use-of-g_hash_table_lookup_exten.patch | 42 +++++++++++++++++++ gcr.spec | 9 +++- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 0001-system-prompter-Fix-use-of-g_hash_table_lookup_exten.patch diff --git a/0001-system-prompter-Fix-use-of-g_hash_table_lookup_exten.patch b/0001-system-prompter-Fix-use-of-g_hash_table_lookup_exten.patch new file mode 100644 index 0000000..37e34b4 --- /dev/null +++ b/0001-system-prompter-Fix-use-of-g_hash_table_lookup_exten.patch @@ -0,0 +1,42 @@ +From 038962d643361f44ddb58ae9611a9386b291e7f1 Mon Sep 17 00:00:00 2001 +From: Daiki Ueno +Date: Sat, 29 Sep 2018 09:40:14 +0200 +Subject: [PATCH] system-prompter: Fix use of g_hash_table_lookup_extended + +Since the glib commit 8dc8b33d, g_hash_table_lookup_extended() started +to clear the argument to NULL, even if the lookup failed. Do not +expect the original key is preserved in that case. + +Fixes #9. +--- + gcr/gcr-system-prompter.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/gcr/gcr-system-prompter.c b/gcr/gcr-system-prompter.c +index 975abe4..39250e7 100644 +--- a/gcr/gcr-system-prompter.c ++++ b/gcr/gcr-system-prompter.c +@@ -491,17 +491,19 @@ prompt_stop_prompting (GcrSystemPrompter *self, + ActivePrompt *active; + GVariant *retval; + gpointer watch; ++ Callback *orig_callback; + + g_debug ("stopping prompting for operation %s@%s", + callback->path, callback->name); + + /* Get a pointer to our actual callback */ + if (!g_hash_table_lookup_extended (self->pv->callbacks, callback, +- (gpointer *)&callback, &watch)) { ++ (gpointer *)&orig_callback, &watch)) { + g_debug ("couldn't find the callback for prompting operation %s@%s", + callback->path, callback->name); + return; + } ++ callback = orig_callback; + + /* + * We remove these from the callbacks hash table so that we don't +-- +2.19.1 + diff --git a/gcr.spec b/gcr.spec index 0f4996a..67b51a2 100644 --- a/gcr.spec +++ b/gcr.spec @@ -4,12 +4,14 @@ Name: gcr Version: 3.28.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A library for bits of crypto UI and parsing License: LGPLv2+ URL: https://wiki.gnome.org/Projects/CryptoGlue Source0: https://download.gnome.org/sources/%{name}/3.28/%{name}-%{version}.tar.xz +# Fix gnome-shell crashes with glib 2.59 +Patch0: 0001-system-prompter-Fix-use-of-g_hash_table_lookup_exten.patch BuildRequires: pkgconfig(gio-unix-2.0) BuildRequires: pkgconfig(gobject-introspection-1.0) @@ -44,7 +46,7 @@ The gcr-devel package includes the header files for the gcr library. %prep -%setup -q +%autosetup -p1 # Use system valgrind headers instead %if 0%{?has_valgrind} @@ -114,6 +116,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/gcr-viewer.desktop %changelog +* Fri Jan 04 2019 Kalev Lember - 3.28.0-3 +- Backport a patch to fix gnome-shell crashes with glib 2.59 + * Fri Jul 13 2018 Fedora Release Engineering - 3.28.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild