!8 fix CVE-2020-16125

From: @angela7
Reviewed-by: @small_leek
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2020-11-19 11:16:41 +08:00 committed by Gitee
commit d710f1a535
2 changed files with 64 additions and 2 deletions

View File

@ -0,0 +1,58 @@
From 4e6e5335d29c039bed820c43bfd1c19cb62539ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Tue, 27 Oct 2020 15:38:28 +0100
Subject: [PATCH] display: Use autoptr to handle errors in look for existing
users
It will make things just cleaner
---
daemon/gdm-display.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c
index 5e193f2..a65cbf1 100644
--- a/daemon/gdm-display.c
+++ b/daemon/gdm-display.c
@@ -539,9 +539,9 @@ gdm_display_real_prepare (GdmDisplay *self)
static void
look_for_existing_users_sync (GdmDisplay *self)
{
- GError *error = NULL;
- GVariant *call_result;
- GVariant *user_list;
+ g_autoptr(GError) error = NULL;
+ g_autoptr(GVariant) call_result = NULL;
+ g_autoptr(GVariant) user_list = NULL;
self->priv->accountsservice_proxy = g_dbus_proxy_new_sync (self->priv->connection,
0, NULL,
@@ -553,7 +553,7 @@ look_for_existing_users_sync (GdmDisplay *self)
if (!self->priv->accountsservice_proxy) {
g_warning ("Failed to contact accountsservice: %s", error->message);
- goto out;
+ return FALSE;
}
call_result = g_dbus_proxy_call_sync (self->priv->accountsservice_proxy,
@@ -566,15 +566,12 @@ look_for_existing_users_sync (GdmDisplay *self)
if (!call_result) {
g_warning ("Failed to list cached users: %s", error->message);
- goto out;
+ return FALSE;
}
g_variant_get (call_result, "(@ao)", &user_list);
self->priv->have_existing_user_accounts = g_variant_n_children (user_list) > 0;
- g_variant_unref (user_list);
- g_variant_unref (call_result);
-out:
- g_clear_error (&error);
+ return TRUE;
}
gboolean
--
1.8.3.1

View File

@ -1,12 +1,13 @@
Name: gdm
Epoch: 1
Version: 3.30.1
Release: 7
Release: 8
Summary: A graphical display manager
License: GPLv2+
URL: https://wiki.gnome.org/Projects/GDM
Source0: http://download.gnome.org/sources/gdm/3.30/gdm-%{version}.tar.xz
Patch9000: 9000-add-openeuler-pam-config.patch
Patch0: 9000-add-openeuler-pam-config.patch
Patch1: display-Use-autoptr-to-handle-errors-in-look-for-exi.patch
BuildRequires: pam-devel >= 0:0.99.8.1-11 desktop-file-utils >= 0.2.90
BuildRequires: libtool automake autoconf libattr-devel gettext-devel libdmx-devel
@ -161,6 +162,9 @@ fi
%{_libdir}/pkgconfig/*.pc
%changelog
* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 1:3.30.1-8
- fix CVE-2020-16125
* Tue Jan 14 2020 openEuler Buildteam <buildteam@openeuler.org> - 1:3.30.1-7
- Type:bugfix
- Id:NA