From 4f3de91b9d608bc7cc058bdd9ea18f6597c658c1 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 12 2018 20:25:50 +0000 Subject: import gdm-3.28.2-10.el7 --- diff --git a/SOURCES/0001-manager-plug-leak-in-maybe_activate_other_session.patch b/SOURCES/0001-manager-plug-leak-in-maybe_activate_other_session.patch index 847870b..9b961d9 100644 --- a/SOURCES/0001-manager-plug-leak-in-maybe_activate_other_session.patch +++ b/SOURCES/0001-manager-plug-leak-in-maybe_activate_other_session.patch @@ -1,7 +1,7 @@ From 82006d15b70842d2b1ad7d47d9490e315436cb5f Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 22 Jun 2018 14:44:11 -0400 -Subject: [PATCH 1/6] manager: plug leak in maybe_activate_other_session +Subject: [PATCH 1/7] manager: plug leak in maybe_activate_other_session The function asks logind what the currently active session is on the given seat. It then leaks the response. diff --git a/SOURCES/0002-manager-start-login-screen-if-old-one-is-finished.patch b/SOURCES/0002-manager-start-login-screen-if-old-one-is-finished.patch index d14b87b..0fe31cf 100644 --- a/SOURCES/0002-manager-start-login-screen-if-old-one-is-finished.patch +++ b/SOURCES/0002-manager-start-login-screen-if-old-one-is-finished.patch @@ -1,7 +1,7 @@ From 6b4402fb0bbf17803c2354e92fc448a537d2d506 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 22 Jun 2018 14:55:39 -0400 -Subject: [PATCH 2/6] manager: start login screen if old one is finished +Subject: [PATCH 2/7] manager: start login screen if old one is finished Since commit 22c332ba we try to start a login screen if we end up on an empty VT and there isn't one running. diff --git a/SOURCES/0003-manager-don-t-bail-if-session-disappears-out-from-un.patch b/SOURCES/0003-manager-don-t-bail-if-session-disappears-out-from-un.patch index 5a85f3e..0ac74ac 100644 --- a/SOURCES/0003-manager-don-t-bail-if-session-disappears-out-from-un.patch +++ b/SOURCES/0003-manager-don-t-bail-if-session-disappears-out-from-un.patch @@ -1,7 +1,7 @@ From 64779fcad9efa9fdb4b1a8963e2386cf763e53d8 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 22 Jun 2018 15:26:03 -0400 -Subject: [PATCH 3/6] manager: don't bail if session disappears out from under +Subject: [PATCH 3/7] manager: don't bail if session disappears out from under us It's entirely possible for a session returned by diff --git a/SOURCES/0004-manager-make-get_login_window_session_id-fail-if-no-.patch b/SOURCES/0004-manager-make-get_login_window_session_id-fail-if-no-.patch index 35acf75..bd4dbcf 100644 --- a/SOURCES/0004-manager-make-get_login_window_session_id-fail-if-no-.patch +++ b/SOURCES/0004-manager-make-get_login_window_session_id-fail-if-no-.patch @@ -1,7 +1,7 @@ From 65c3fc674ee4ec0f5139973aa53114db2f1fcf45 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 17 Jul 2018 15:40:25 -0400 -Subject: [PATCH 4/6] manager: make get_login_window_session_id fail if no +Subject: [PATCH 4/7] manager: make get_login_window_session_id fail if no login screen Right now we oddly succeed from get_login_window_session_id diff --git a/SOURCES/0005-daemon-try-harder-to-get-to-a-login-screen-at-logout.patch b/SOURCES/0005-daemon-try-harder-to-get-to-a-login-screen-at-logout.patch index 2d000a8..3879eec 100644 --- a/SOURCES/0005-daemon-try-harder-to-get-to-a-login-screen-at-logout.patch +++ b/SOURCES/0005-daemon-try-harder-to-get-to-a-login-screen-at-logout.patch @@ -1,7 +1,7 @@ From b7b492296a69bc5100ff5908048ed5ef121d3587 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 30 Jul 2018 16:21:29 -0400 -Subject: [PATCH 5/6] daemon: try harder to get to a login screen at logout +Subject: [PATCH 5/7] daemon: try harder to get to a login screen at logout commit 22c332ba and some follow up commits try to ensure the user never stays on a blank VT by jumping to a login screen in diff --git a/SOURCES/0006-daemon-ensure-is-initial-bit-is-transferred-to-new-l.patch b/SOURCES/0006-daemon-ensure-is-initial-bit-is-transferred-to-new-l.patch index 633a3d9..f1d0fe4 100644 --- a/SOURCES/0006-daemon-ensure-is-initial-bit-is-transferred-to-new-l.patch +++ b/SOURCES/0006-daemon-ensure-is-initial-bit-is-transferred-to-new-l.patch @@ -1,7 +1,7 @@ From 91eee14bcd2447d78ad00e3de9d4380e423cb897 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 24 Sep 2018 10:53:53 -0400 -Subject: [PATCH 6/6] daemon: ensure is-initial bit is transferred to new login +Subject: [PATCH 6/7] daemon: ensure is-initial bit is transferred to new login screen at logout At the moment, when a user logs out we call sync_seats to restart the diff --git a/SOURCES/0007-local-display-factory-try-even-harder-to-get-to-a-lo.patch b/SOURCES/0007-local-display-factory-try-even-harder-to-get-to-a-lo.patch new file mode 100644 index 0000000..bad3a28 --- /dev/null +++ b/SOURCES/0007-local-display-factory-try-even-harder-to-get-to-a-lo.patch @@ -0,0 +1,118 @@ +From 72782991144e8e6671c2dbed6fe1727e2dc329fb Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Thu, 4 Oct 2018 14:01:44 -0400 +Subject: [PATCH 7/7] local-display-factory: try even harder to get to a login + screen + +At the moment we sometimes fail to create a login screen when +logout results in the user ending up on an empty VT. + +That is because we're accidentally running into the non-seat0 +code path for seat0. + +This commit addresses the problem by specifically checking for +if the seat is multi-session capable rather than checking if +the seat has an active session. +--- + daemon/gdm-local-display-factory.c | 19 +++++++++++-------- + 1 file changed, 11 insertions(+), 8 deletions(-) + +diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c +index 8b0b2e5c2..cf4f5095c 100644 +--- a/daemon/gdm-local-display-factory.c ++++ b/daemon/gdm-local-display-factory.c +@@ -459,80 +459,83 @@ get_login_window_session_id (const char *seat_id, + free (service_id); + goto out; + } + + free (service_id); + } + + *session_id = NULL; + ret = FALSE; + + out: + if (sessions) { + for (i = 0; sessions[i]; i ++) { + free (sessions[i]); + } + + free (sessions); + } + + return ret; + } + + static GdmDisplay * + create_display (GdmLocalDisplayFactory *factory, + const char *seat_id, + const char *session_type, + gboolean initial) + { + GdmDisplayStore *store; + GdmDisplay *display = NULL; +- char *active_session_id = NULL; + int ret; + + store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory)); + +- ret = sd_seat_get_active (seat_id, &active_session_id, NULL); +- +- if (ret == 0) { ++ if (sd_seat_can_multi_session (seat_id)) { + char *login_session_id = NULL; + + /* If we already have a login window, switch to it */ + if (get_login_window_session_id (seat_id, &login_session_id)) { +- if (g_strcmp0 (active_session_id, login_session_id) != 0) { ++ char *active_session_id = NULL; ++ ++ ret = sd_seat_get_active (seat_id, &active_session_id, NULL); ++ ++ if (ret == 0 && g_strcmp0 (active_session_id, login_session_id) != 0) { + activate_session_id (factory, seat_id, login_session_id); ++ ++ g_clear_pointer (&login_session_id, g_free); ++ g_clear_pointer (&active_session_id, g_free); ++ return NULL; + } ++ + g_clear_pointer (&login_session_id, g_free); +- g_clear_pointer (&active_session_id, g_free); +- return NULL; + } +- g_clear_pointer (&active_session_id, g_free); + } else { + /* Ensure we don't create the same display more than once */ + display = gdm_display_store_find (store, lookup_by_seat_id, (gpointer) seat_id); + + if (display != NULL) { + return NULL; + } + } + + g_debug ("GdmLocalDisplayFactory: Adding display on seat %s", seat_id); + + #ifdef ENABLE_USER_DISPLAY_SERVER + if (g_strcmp0 (seat_id, "seat0") == 0) { + display = gdm_local_display_new (); + if (session_type != NULL) { + g_object_set (G_OBJECT (display), "session-type", session_type, NULL); + } + } + #endif + + if (display == NULL) { + guint32 num; + + num = take_next_display_number (factory); + + display = gdm_legacy_display_new (num); + } + + g_object_set (display, "seat-id", seat_id, NULL); + g_object_set (display, "is-initial", initial, NULL); +-- +2.17.1 + diff --git a/SPECS/gdm.spec b/SPECS/gdm.spec index 47295ce..65bb8d6 100644 --- a/SPECS/gdm.spec +++ b/SPECS/gdm.spec @@ -10,7 +10,7 @@ Name: gdm Epoch: 1 Version: 3.28.2 -Release: 9%{?dist} +Release: 10%{?dist} Summary: The GNOME Display Manager License: GPLv2+ @@ -37,6 +37,7 @@ Patch62: 0003-manager-don-t-bail-if-session-disappears-out-from-un.patch Patch63: 0004-manager-make-get_login_window_session_id-fail-if-no-.patch Patch64: 0005-daemon-try-harder-to-get-to-a-login-screen-at-logout.patch Patch65: 0006-daemon-ensure-is-initial-bit-is-transferred-to-new-l.patch +Patch66: 0007-local-display-factory-try-even-harder-to-get-to-a-lo.patch Patch70: 0001-daemon-gdm-session-record.c-open-close-the-utmp-data.patch @@ -357,6 +358,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor >&/dev/null || : %{_libdir}/pkgconfig/gdm-pam-extensions.pc %changelog +* Fri Oct 05 2018 Ray Strode - 3.28.2-10 +- another user switching fix + Resolves: #1489977 + * Mon Sep 24 2018 Ray Strode - 3.28.2-9 - fast user switching fix Related: #1597339