Accepting request 686015 from home:iznogood:branches:GNOME:Factory

- Add gnome-control-center-fix-crash-retrive-disksize.patch: info:
  Fix crashes when retrieving disk size. Patch from upstream stable
  branch, to be dropped when switching to 3.32 branch as the issue
  is fixed in a different way there.

OBS-URL: https://build.opensuse.org/request/show/686015
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gnome-control-center?expand=0&rev=407
This commit is contained in:
Bjørn Lie 2019-03-18 10:04:53 +00:00 committed by Git OBS Bridge
parent 8fe5bdf77c
commit 5d16fe3de4
3 changed files with 95 additions and 1 deletions

View File

@ -0,0 +1,83 @@
From 26287234bd9152fbe95baa82b9d55b8064d789c2 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 13 Mar 2019 15:49:33 +0100
Subject: [PATCH] info: Fix crashes when retrieving disk size
Info panel crashes has been fixed by !387 on master branch, however,
gnome-3-30 is still affected as the same fix can't be used there, because
its complexity and changed dependencies. The panel crashes because
GUnixMountPoint is by mistake used as GUnixMountEntry. Let's find
and use corresponing GUnixMountEntry to simply fix those crashes for
gnome-3-30.
Closes: #411
---
panels/info/cc-info-overview-panel.c | 33 +++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)
diff --git a/panels/info/cc-info-overview-panel.c b/panels/info/cc-info-overview-panel.c
index 7758271b1..fa9510b06 100644
--- a/panels/info/cc-info-overview-panel.c
+++ b/panels/info/cc-info-overview-panel.c
@@ -546,10 +546,30 @@ get_primary_disc_info_start (CcInfoOverviewPanel *self)
self);
}
+static GList *
+convert_points_to_entries (GList *points)
+{
+ GList *entries = NULL;
+ GList *p;
+
+ for (p = points; p != NULL; p = p->next)
+ {
+ GUnixMountPoint *point = p->data;
+ GUnixMountEntry *mount;
+ const gchar *mount_path = g_unix_mount_point_get_mount_path (point);
+
+ mount = g_unix_mount_at (mount_path, NULL);
+ if (mount)
+ entries = g_list_append (entries, mount);
+ }
+
+ return entries;
+}
+
static void
get_primary_disc_info (CcInfoOverviewPanel *self)
{
- GList *points;
+ GList *points, *entries = NULL;
GList *p;
GHashTable *hash;
CcInfoOverviewPanelPrivate *priv = cc_info_overview_panel_get_instance_private (self);
@@ -557,11 +577,14 @@ get_primary_disc_info (CcInfoOverviewPanel *self)
hash = g_hash_table_new (g_str_hash, g_str_equal);
points = g_unix_mount_points_get (NULL);
+ entries = convert_points_to_entries (points);
+ g_list_free_full (points, (GDestroyNotify) g_unix_mount_point_free);
+
/* If we do not have /etc/fstab around, try /etc/mtab */
- if (points == NULL)
- points = g_unix_mounts_get (NULL);
+ if (entries == NULL)
+ entries = g_unix_mounts_get (NULL);
- for (p = points; p != NULL; p = p->next)
+ for (p = entries; p != NULL; p = p->next)
{
GUnixMountEntry *mount = p->data;
const char *mount_path;
@@ -586,7 +609,7 @@ get_primary_disc_info (CcInfoOverviewPanel *self)
priv->primary_mounts = g_list_prepend (priv->primary_mounts, mount);
g_hash_table_insert (hash, (gpointer) device_path, (gpointer) device_path);
}
- g_list_free (points);
+ g_list_free (entries);
g_hash_table_destroy (hash);
priv->cancellable = g_cancellable_new ();
--
2.18.1

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Mar 18 09:55:17 UTC 2019 - Bjørn Lie <bjorn.lie@gmail.com>
- Add gnome-control-center-fix-crash-retrive-disksize.patch: info:
Fix crashes when retrieving disk size. Patch from upstream stable
branch, to be dropped when switching to 3.32 branch as the issue
is fixed in a different way there.
-------------------------------------------------------------------
Wed Feb 27 02:50:29 UTC 2019 - sckang@suse.com

View File

@ -12,7 +12,7 @@
# 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/
#
@ -40,6 +40,8 @@ Patch0: gnome-control-center-disable-error-message-for-NM.patch
Patch1: control-center-network-add-domain-suffix-match.patch
# PATCH-FIX-UPSTREAM control-center-network-fix-ce-apply-button.patch glgo#GNOME/gnome-control-center!402 bsc#1040054 sckang@suse.com -- network: disable the "Apply" button until a change has been made
Patch2: control-center-network-fix-ce-apply-button.patch
# PATCH-FIX-UPSTREAM gnome-control-center-fix-crash-retrive-disksize.patch -- info: Fix crashes when retrieving disk size
Patch3: gnome-control-center-fix-crash-retrive-disksize.patch
### patches for Leap >= 15 plus SLE >= 15, but not TW
# PATCH-FEATURE-SLE gnome-control-center-info-never-use-gnome-software.patch bsc#999336 fezhang@suse.com -- info: Never search for gnome-software as an option when checking for updates on SLE and Leap 42.2, because we use gpk-update-viewer.
@ -191,6 +193,7 @@ GNOME control center.
#patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
translation-update-upstream po gnome-control-center-2.0
# patches for Leap >= 15 plus SLE >= 15, but not TW