Backport a patch to fix gnome-shell crashes with glib 2.59

This commit is contained in:
Kalev Lember 2019-01-04 09:14:35 +01:00
parent 65822078d9
commit c5b4e55b4d
2 changed files with 49 additions and 2 deletions

View File

@ -0,0 +1,42 @@
From 038962d643361f44ddb58ae9611a9386b291e7f1 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <dueno@src.gnome.org>
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

View File

@ -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 <klember@redhat.com> - 3.28.0-3
- Backport a patch to fix gnome-shell crashes with glib 2.59
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.28.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild