From 523f1e64fc941779ccb9c9174c6cb9b02f0e24ff Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 15 2022 09:11:29 +0000 Subject: import gdm-40.0-15.el8_5.1 --- diff --git a/SOURCES/0001-local-display-factory-Provide-more-flexibility-for-c.patch b/SOURCES/0001-local-display-factory-Provide-more-flexibility-for-c.patch index 346c27e..ad8458c 100644 --- a/SOURCES/0001-local-display-factory-Provide-more-flexibility-for-c.patch +++ b/SOURCES/0001-local-display-factory-Provide-more-flexibility-for-c.patch @@ -1,7 +1,7 @@ -From 4ef82bf0fe40dd3952997a77539a57e8cb8b99ef Mon Sep 17 00:00:00 2001 +From e5c58e1663845d46b368063f8137eab5f2e1c01b Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 16 Jul 2021 12:34:57 -0400 -Subject: [PATCH 1/2] local-display-factory: Provide more flexibility for +Subject: [PATCH 1/4] local-display-factory: Provide more flexibility for configuring display server There's currently a way to disable wayland, but no way to disable Xorg. @@ -2761,5 +2761,5 @@ index 75d442ee..97ed5ef3 100644 while (g_hash_table_iter_next (&iter, &key, &value)) { GdmSessionFile *session; -- -2.27.0 +2.34.1 diff --git a/SOURCES/0001-local-display-factory-pause-for-a-few-seconds-before.patch b/SOURCES/0001-local-display-factory-pause-for-a-few-seconds-before.patch index 9a5582a..25d8588 100644 --- a/SOURCES/0001-local-display-factory-pause-for-a-few-seconds-before.patch +++ b/SOURCES/0001-local-display-factory-pause-for-a-few-seconds-before.patch @@ -1,8 +1,8 @@ -From 903dd62114d24a90fe55a7cf42ea07233fe71879 Mon Sep 17 00:00:00 2001 +From 17297d7c33916d749375dd7d66f202551b708bf6 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 29 Oct 2018 06:57:59 -0400 -Subject: [PATCH] local-display-factory: pause for a few seconds before - falling back to X +Subject: [PATCH] local-display-factory: pause for a few seconds before falling + back to X logind currently gets confused if a session is started immediately as one is shutting down. @@ -16,15 +16,10 @@ http://bugzilla.redhat.com/1643874 1 file changed, 7 insertions(+) diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c -index eba38671..948c5d98 100644 +index c00e1c47..9461cc43 100644 --- a/daemon/gdm-local-display-factory.c +++ b/daemon/gdm-local-display-factory.c -@@ -653,60 +653,67 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory, - preferred_display_server = get_preferred_display_server (factory); - - if (g_strcmp0 (preferred_display_server, "none") == 0) { - g_debug ("GdmLocalDisplayFactory: Preferred display server is none, so not creating display"); - return; +@@ -664,60 +664,67 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory, } ret = sd_seat_can_graphical (seat_id); @@ -48,8 +43,13 @@ index eba38671..948c5d98 100644 falling_back = factory->num_failures > 0; session_types = gdm_local_display_factory_get_session_types (factory, falling_back); - g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s", - session_types[0], falling_back? " fallback" : ""); + if (session_types == NULL) { + g_debug ("GdmLocalDisplayFactory: Both Wayland and Xorg are unavailable"); + seat_supports_graphics = FALSE; + } else { + g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s", + session_types[0], falling_back? " fallback" : ""); + } + + if (falling_back) { + /* workaround logind race for now @@ -88,5 +88,5 @@ index eba38671..948c5d98 100644 g_debug ("GdmLocalDisplayFactory: seat0 doesn't yet support graphics. Waiting %d seconds to try again.", SEAT0_GRAPHICS_CHECK_TIMEOUT); factory->seat0_graphics_check_timeout_id = g_timeout_add_seconds (SEAT0_GRAPHICS_CHECK_TIMEOUT, -- -2.27.0 +2.34.1 diff --git a/SOURCES/0002-libgdm-Sort-session-list.patch b/SOURCES/0002-libgdm-Sort-session-list.patch index 108c85c..008a828 100644 --- a/SOURCES/0002-libgdm-Sort-session-list.patch +++ b/SOURCES/0002-libgdm-Sort-session-list.patch @@ -1,7 +1,7 @@ -From 677d370e892788635c4086b139d78499510fa86c Mon Sep 17 00:00:00 2001 +From 9b3d81889d8497f029e860bd2f8288272333cae8 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 20 Jul 2021 13:36:45 -0400 -Subject: [PATCH 2/2] libgdm: Sort session list +Subject: [PATCH 2/4] libgdm: Sort session list Right now the session list comes out in hash table order. @@ -127,5 +127,5 @@ index 97ed5ef3..f078e04b 100644 if (session == NULL) { return NULL; -- -2.27.0 +2.34.1 diff --git a/SOURCES/0003-xdmcp-display-factory-Set-supported-session-types-fo.patch b/SOURCES/0003-xdmcp-display-factory-Set-supported-session-types-fo.patch index 8e5eb3e..9d24ad7 100644 --- a/SOURCES/0003-xdmcp-display-factory-Set-supported-session-types-fo.patch +++ b/SOURCES/0003-xdmcp-display-factory-Set-supported-session-types-fo.patch @@ -1,7 +1,7 @@ -From e3a7ca44c0153ffa895786eabb020810b138eea2 Mon Sep 17 00:00:00 2001 +From 7d5b0ed505ec38c4aef51d125d01a2733f4a237f Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 14 Sep 2021 11:00:33 -0400 -Subject: [PATCH 3/3] xdmcp-display-factory: Set supported session types for +Subject: [PATCH 3/4] xdmcp-display-factory: Set supported session types for XDMCP displays The lower levels of GDM now expect the session types supported by a @@ -13,7 +13,7 @@ This commit makes sure XDMCP displays do that. 1 file changed, 6 insertions(+) diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c -index ce8f026e1..558458f1c 100644 +index ce8f026e..abb58fae 100644 --- a/daemon/gdm-xdmcp-display-factory.c +++ b/daemon/gdm-xdmcp-display-factory.c @@ -2104,94 +2104,100 @@ on_display_status_changed (GdmDisplay *display, @@ -118,5 +118,5 @@ index ce8f026e1..558458f1c 100644 ARRAY8Ptr authorization_data) { -- -2.31.1 +2.34.1 diff --git a/SOURCES/0004-local-display-factory-Don-t-crash-if-Xorg-and-Waylan.patch b/SOURCES/0004-local-display-factory-Don-t-crash-if-Xorg-and-Waylan.patch new file mode 100644 index 0000000..d7d9db3 --- /dev/null +++ b/SOURCES/0004-local-display-factory-Don-t-crash-if-Xorg-and-Waylan.patch @@ -0,0 +1,96 @@ +From 83ba20c428c3839e8ce974ffa13712f92d5980ea Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Thu, 7 Oct 2021 15:34:27 -0400 +Subject: [PATCH 4/4] local-display-factory: Don't crash if Xorg and Wayland + are both unavailable + +At the moment if Wayland doesn't work, the login screen will fall back +to Xorg, and if Xorg doesn't work the login screen will fall back to +Wayland. + +But if the fall back choice is disabled explicitly, GDM will just crash. + +This commit fixes the crash. + +Closes: https://gitlab.gnome.org/GNOME/gdm/-/issues/739 +--- + daemon/gdm-local-display-factory.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c +index eba38671..120847f9 100644 +--- a/daemon/gdm-local-display-factory.c ++++ b/daemon/gdm-local-display-factory.c +@@ -651,62 +651,67 @@ ensure_display_for_seat (GdmLocalDisplayFactory *factory, + gdm_settings_direct_get_boolean (GDM_KEY_XORG_ENABLE, &xorg_enabled); + + preferred_display_server = get_preferred_display_server (factory); + + if (g_strcmp0 (preferred_display_server, "none") == 0) { + g_debug ("GdmLocalDisplayFactory: Preferred display server is none, so not creating display"); + return; + } + + ret = sd_seat_can_graphical (seat_id); + + if (ret < 0) { + g_critical ("Failed to query CanGraphical information for seat %s", seat_id); + return; + } + + if (ret == 0) { + g_debug ("GdmLocalDisplayFactory: System doesn't currently support graphics"); + seat_supports_graphics = FALSE; + } else { + g_debug ("GdmLocalDisplayFactory: System supports graphics"); + seat_supports_graphics = TRUE; + } + + if (g_strcmp0 (seat_id, "seat0") == 0) { + is_seat0 = TRUE; + + falling_back = factory->num_failures > 0; + session_types = gdm_local_display_factory_get_session_types (factory, falling_back); + +- g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s", +- session_types[0], falling_back? " fallback" : ""); ++ if (session_types == NULL) { ++ g_debug ("GdmLocalDisplayFactory: Both Wayland and Xorg are unavailable"); ++ seat_supports_graphics = FALSE; ++ } else { ++ g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s", ++ session_types[0], falling_back? " fallback" : ""); ++ } + } else { + is_seat0 = FALSE; + + g_debug ("GdmLocalDisplayFactory: New displays on seat %s will use X11 fallback", seat_id); + /* Force legacy X11 for all auxiliary seats */ + seat_supports_graphics = TRUE; + session_types = g_strdupv ((char **) legacy_session_types); + } + + /* For seat0, we have a fallback logic to still try starting it after + * SEAT0_GRAPHICS_CHECK_TIMEOUT seconds. i.e. we simply continue even if + * CanGraphical is unset. + * This is ugly, but it means we'll come up eventually in some + * scenarios where no master device is present. + * Note that we'll force an X11 fallback even though there might be + * cases where an wayland capable device is present and simply not marked as + * master-of-seat. In these cases, this should likely be fixed in the + * udev rules. + * + * At the moment, systemd always sets CanGraphical for non-seat0 seats. + * This is because non-seat0 seats are defined by having master-of-seat + * set. This means we can avoid the fallback check for non-seat0 seats, + * which simplifies the code. + */ + if (is_seat0) { + if (!seat_supports_graphics) { + if (!factory->seat0_graphics_check_timed_out) { + if (factory->seat0_graphics_check_timeout_id == 0) { + g_debug ("GdmLocalDisplayFactory: seat0 doesn't yet support graphics. Waiting %d seconds to try again.", SEAT0_GRAPHICS_CHECK_TIMEOUT); + factory->seat0_graphics_check_timeout_id = g_timeout_add_seconds (SEAT0_GRAPHICS_CHECK_TIMEOUT, +-- +2.34.1 + diff --git a/SPECS/gdm.spec b/SPECS/gdm.spec index 92deefd..6eaf3c2 100644 --- a/SPECS/gdm.spec +++ b/SPECS/gdm.spec @@ -12,7 +12,7 @@ Name: gdm Epoch: 1 Version: 40.0 -Release: 15%{?dist} +Release: 15%{?dist}.1 Summary: The GNOME Display Manager License: GPLv2+ @@ -24,6 +24,7 @@ Source1: org.gnome.login-screen.gschema.override Patch10001: 0001-local-display-factory-Provide-more-flexibility-for-c.patch Patch10002: 0002-libgdm-Sort-session-list.patch Patch10003: 0003-xdmcp-display-factory-Set-supported-session-types-fo.patch +Patch10004: 0004-local-display-factory-Don-t-crash-if-Xorg-and-Waylan.patch # Race fix Patch40001: 0001-display-Handle-failure-before-display-registration.patch @@ -364,6 +365,10 @@ fi %{_libdir}/pkgconfig/gdm-pam-extensions.pc %changelog +* Thu Jan 27 2022 Ray Strode - 40.0-15.1 +- Fix crash when neither Xorg nor wayland is working great + Resolves: #2036584 + * Wed Sep 15 2021 Ray Strode - 40.0-14 - Fix XDMCP Resolves: #2004170