SHA256
1
0
forked from pool/gdm

Accepting request 797868 from home:yfjiang:branches:GNOME:Factory

- Burnish gdm-look-for-session-based-on-pid-first.patch according
  to the upstream change (bsc#1159950, glgo#GNOME/gdm#526).

- Disable gnome-initial-setup under gdm mode in Leap and SLE
  (jsc#SLE-11856).

OBS-URL: https://build.opensuse.org/request/show/797868
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gdm?expand=0&rev=452
This commit is contained in:
Dominique Leuenberger 2020-04-27 17:40:27 +00:00 committed by Git OBS Bridge
parent b60e7bb2d6
commit 97d1455cd9
3 changed files with 43 additions and 29 deletions

View File

@ -1,4 +1,4 @@
From 82c3c9bbe924c43e93e74cd622207a54bc44962c Mon Sep 17 00:00:00 2001
From 32646105196ed7a687f3684b69ea544dd01d2ade Mon Sep 17 00:00:00 2001
From: Benjamin Berg <bberg@redhat.com>
Date: Thu, 23 Jan 2020 14:32:38 +0100
Subject: [PATCH] manager: Try looking up session based on PID first
@ -21,11 +21,11 @@ See: #526
libgdm/gdm-user-switching.c | 2 +-
4 files changed, 32 insertions(+), 9 deletions(-)
Index: gdm-3.34.1/common/gdm-common.c
===================================================================
--- gdm-3.34.1.orig/common/gdm-common.c
+++ gdm-3.34.1/common/gdm-common.c
@@ -497,7 +497,7 @@ goto_login_session (GDBusConnection *co
diff --git a/common/gdm-common.c b/common/gdm-common.c
index 41bdb389..b8de7555 100644
--- a/common/gdm-common.c
+++ b/common/gdm-common.c
@@ -497,7 +497,7 @@ goto_login_session (GDBusConnection *connection,
* since the data allocated is from libsystemd-logind, which
* does not use GLib's g_malloc (). */
@ -34,14 +34,14 @@ Index: gdm-3.34.1/common/gdm-common.c
g_propagate_prefixed_error (error, local_error, _("Could not identify the current session: "));
return FALSE;
@@ -900,16 +900,38 @@ _systemd_session_is_active (const char *
@@ -898,16 +898,38 @@ _systemd_session_is_active (const char *session_id)
}
gboolean
-gdm_find_display_session_for_uid (const uid_t uid,
- char **out_session_id,
- GError **error)
+gdm_find_display_session (int pid,
+gdm_find_display_session (GPid pid,
+ const uid_t uid,
+ char **out_session_id,
+ GError **error)
@ -61,44 +61,44 @@ Index: gdm-3.34.1/common/gdm-common.c
+ */
+ res = sd_pid_get_session (pid, &local_session_id);
+ if (res >= 0) {
+ g_debug ("Found session %s for PID %d, using", local_session_id, pid);
+ g_debug ("GdmCommon: Found session %s for PID %d, using", local_session_id, pid);
+
+ *out_session_id = g_strdup (local_session_id);
+ g_free (local_session_id);
+ free (local_session_id);
+
+ return TRUE;
+ } else {
+ if (res != -ENODATA)
+ g_warning ("Failed to retrieve session information for pid %d: %s",
+ g_warning ("GdmCommon: Failed to retrieve session information for pid %d: %s",
+ pid, strerror (-res));
+ }
+
g_debug ("Finding a graphical session for user %d", uid);
n_sessions = sd_uid_get_sessions (uid,
Index: gdm-3.34.1/common/gdm-common.h
===================================================================
--- gdm-3.34.1.orig/common/gdm-common.h
+++ gdm-3.34.1/common/gdm-common.h
@@ -51,9 +51,10 @@ int gdm_wait_on_and_disown_pi
diff --git a/common/gdm-common.h b/common/gdm-common.h
index 5c3fe137..001b70c1 100644
--- a/common/gdm-common.h
+++ b/common/gdm-common.h
@@ -51,9 +51,10 @@ int gdm_wait_on_and_disown_pid (int pid,
int gdm_signal_pid (int pid,
int signal);
-gboolean gdm_find_display_session_for_uid (const uid_t uid,
- char **out_session_id,
- GError **error);
+gboolean gdm_find_display_session (int pid,
+gboolean gdm_find_display_session (GPid pid,
+ const uid_t uid,
+ char **out_session_id,
+ GError **error);
gboolean gdm_get_pwent_for_name (const char *name,
struct passwd **pwentp);
Index: gdm-3.34.1/daemon/gdm-manager.c
===================================================================
--- gdm-3.34.1.orig/daemon/gdm-manager.c
+++ gdm-3.34.1/daemon/gdm-manager.c
@@ -501,7 +501,7 @@ get_display_and_details_for_bus_sender (
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index 907eca37..d8dfa843 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -501,7 +501,7 @@ get_display_and_details_for_bus_sender (GdmManager *self,
goto out;
}
@ -107,11 +107,11 @@ Index: gdm-3.34.1/daemon/gdm-manager.c
if (!ret) {
g_debug ("GdmManager: Unable to find display session for uid %d: %s",
Index: gdm-3.34.1/libgdm/gdm-user-switching.c
===================================================================
--- gdm-3.34.1.orig/libgdm/gdm-user-switching.c
+++ gdm-3.34.1/libgdm/gdm-user-switching.c
@@ -203,7 +203,7 @@ goto_login_session (GDBusConnection *co
diff --git a/libgdm/gdm-user-switching.c b/libgdm/gdm-user-switching.c
index 3a33fcbb..20235fd8 100644
--- a/libgdm/gdm-user-switching.c
+++ b/libgdm/gdm-user-switching.c
@@ -203,7 +203,7 @@ goto_login_session (GDBusConnection *connection,
/* Note that we mostly use free () here, instead of g_free ()
* since the data allocated is from libsystemd-logind, which
* does not use GLib's g_malloc (). */
@ -120,3 +120,5 @@ Index: gdm-3.34.1/libgdm/gdm-user-switching.c
g_propagate_prefixed_error (error, local_error, _("Could not identify the current session: "));
return FALSE;
--
2.26.2

View File

@ -1,3 +1,15 @@
-------------------------------------------------------------------
Sun Apr 26 09:42:29 UTC 2020 - Yifan Jiang <yfjiang@suse.com>
- Burnish gdm-look-for-session-based-on-pid-first.patch according
to the upstream change (bsc#1159950, glgo#GNOME/gdm#526).
-------------------------------------------------------------------
Wed Apr 22 01:32:07 UTC 2020 - Yifan Jiang <yfjiang@suse.com>
- Disable gnome-initial-setup under gdm mode in Leap and SLE
(jsc#SLE-11856).
-------------------------------------------------------------------
Sat Apr 18 16:12:21 UTC 2020 - Bjørn Lie <bjorn.lie@gmail.com>

View File

@ -229,8 +229,8 @@ cp %{SOURCE8} .
%patch16 -p1
%patch17 -p1
# SLE-only patches start at 1000
%if !0%{?is_opensuse}
# SLE and Leap only patches start at 1000
%if 0%{?sle_version}
%patch1000 -p1
%endif