From 6b1540debdb004be14da263e526a036a8260ab6d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 29 2022 10:01:56 +0000 Subject: import gdm-40.0-23.el8 --- diff --git a/SOURCES/0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch b/SOURCES/0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch new file mode 100644 index 0000000..5c4e4c7 --- /dev/null +++ b/SOURCES/0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch @@ -0,0 +1,87 @@ +From ff689b18fd0a5fd03e5941723cb2adff3b7e4b24 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 29 Sep 2021 11:03:41 -0400 +Subject: [PATCH] daemon: Infer session type from desktop file if user has no + saved session type + +The accountsservice user cache file can specify a session type +associated with the saved session. This is optional though. If one +isn't specified GDM needs to figure out the session type based on the +list of preferred session types for the system and the session file +itself. + +It was failing to do the latter, though. This commit fixes that. +--- + daemon/gdm-session.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c +index 29459346..72afe7b2 100644 +--- a/daemon/gdm-session.c ++++ b/daemon/gdm-session.c +@@ -988,60 +988,62 @@ worker_on_saved_language_name_read (GdmDBusWorker *worker, + } + } + } + + static void + worker_on_saved_session_name_read (GdmDBusWorker *worker, + const char *session_name, + GdmSessionConversation *conversation) + { + GdmSession *self = conversation->session; + + if (! get_session_command_for_name (self, session_name, NULL)) { + /* ignore sessions that don't exist */ + g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name); + g_free (self->saved_session); + self->saved_session = NULL; + update_session_type (self); + } else { + if (strcmp (session_name, + get_default_session_name (self)) != 0) { + g_free (self->saved_session); + self->saved_session = g_strdup (session_name); + + if (self->greeter_interface != NULL) { + gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface, + session_name); + } + } + if (self->saved_session_type != NULL) + set_session_type (self, self->saved_session_type); ++ else ++ update_session_type (self); + } + + } + + static GdmSessionConversation * + find_conversation_by_pid (GdmSession *self, + GPid pid) + { + GHashTableIter iter; + gpointer key, value; + + g_hash_table_iter_init (&iter, self->conversations); + while (g_hash_table_iter_next (&iter, &key, &value)) { + GdmSessionConversation *conversation; + + conversation = (GdmSessionConversation *) value; + + if (conversation->worker_pid == pid) { + return conversation; + } + } + + return NULL; + } + + static gboolean + allow_worker_function (GDBusAuthObserver *observer, + GIOStream *stream, + GCredentials *credentials, + GdmSession *self) +-- +2.33.1 + diff --git a/SOURCES/0001-data-disable-wayland-on-certain-hardware.patch b/SOURCES/0001-data-disable-wayland-on-certain-hardware.patch index 8aba1da..2e346cb 100644 --- a/SOURCES/0001-data-disable-wayland-on-certain-hardware.patch +++ b/SOURCES/0001-data-disable-wayland-on-certain-hardware.patch @@ -1,4 +1,4 @@ -From afdaf0c31c7fb44e05a271a9047a0993ff1f4ef2 Mon Sep 17 00:00:00 2001 +From e01c0894669f5fe3d1a1c4148b7507e61b95d035 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 11 Feb 2019 18:14:07 -0500 Subject: [PATCH] data: disable wayland on certain hardware @@ -9,14 +9,14 @@ setups, so disable it in those cases. Also disable it on server chips for performance reasons. --- - data/61-gdm.rules.in | 36 ++++++++++++++++++++++++++++++++---- - 1 file changed, 32 insertions(+), 4 deletions(-) + data/61-gdm.rules.in | 39 +++++++++++++++++++++++++++++++++++---- + 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in -index b1da191f8..d863a4a4d 100644 +index b1da191f..d599a146 100644 --- a/data/61-gdm.rules.in +++ b/data/61-gdm.rules.in -@@ -1,6 +1,34 @@ +@@ -1,6 +1,37 @@ # disable Wayland on Hi1710 chipsets -ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false" -# disable Wayland when using the proprietary nvidia driver @@ -44,6 +44,9 @@ index b1da191f8..d863a4a4d 100644 +SUBSYSTEM=="drm", KERNEL=="card[1-9]*", ENV{GDM_HAS_NVIDIA_DRIVER}=="1", RUN+="@libexecdir@/gdm-disable-wayland" +ACTION=="add", SUBSYSTEM=="module", KERNEL=="nvidia_drm", ATTR{parameters/modeset}=="N", RUN+="/usr/libexec/gdm-disable-wayland" + ++# disable Wayland on HyperV guests ++DRIVER=="hyperv_fb", RUN+="@libexecdir@/gdm-disable-wayland" ++ +# disable Wayland on passthrough graphics setups for now (assumes passthrough if +# there is more than one card, and one of the cards is virt: cirrus, bochs, qxl) +ATTR{vendor}=="0x1013", ATTR{device}=="0x00b8", ATTR{subsystem_vendor}=="0x1af4", ATTR{subsystem_device}=="0x1100", ENV{GDM_HAS_VIRTUAL_GPU}="1" @@ -56,5 +59,5 @@ index b1da191f8..d863a4a4d 100644 -IMPORT{cmdline}="nomodeset", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false" +IMPORT{cmdline}="nomodeset", RUN+="@libexecdir@/gdm-disable-wayland" -- -2.31.1 +2.27.0 diff --git a/SOURCES/0001-local-display-factory-Don-t-try-to-respawn-displays-.patch b/SOURCES/0001-local-display-factory-Don-t-try-to-respawn-displays-.patch new file mode 100644 index 0000000..080052f --- /dev/null +++ b/SOURCES/0001-local-display-factory-Don-t-try-to-respawn-displays-.patch @@ -0,0 +1,325 @@ +From d8fd8d4d6ff6a119f6bd27eb07316384c4776d12 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 15 Sep 2021 11:23:17 -0400 +Subject: [PATCH] local-display-factory: Don't try to respawn displays on + shutdown + +At the moment in the shutdown path we may try to respawn displays +that just got killed. + +The respawning happens when things are half torn down leading to +crashes. + +This commit makes sure we turn off the respawn logic in the shutdown +path. +--- + daemon/gdm-local-display-factory.c | 11 ++++++++++- + daemon/gdm-manager.c | 2 ++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c +index 11dcda2c..a0884893 100644 +--- a/daemon/gdm-local-display-factory.c ++++ b/daemon/gdm-local-display-factory.c +@@ -46,60 +46,62 @@ + #define GDM_LOCAL_DISPLAY_FACTORY_DBUS_PATH GDM_DBUS_PATH "/LocalDisplayFactory" + #define GDM_MANAGER_DBUS_NAME "org.gnome.DisplayManager.LocalDisplayFactory" + + #define MAX_DISPLAY_FAILURES 5 + #define WAIT_TO_FINISH_TIMEOUT 10 /* seconds */ + #define SEAT0_GRAPHICS_CHECK_TIMEOUT 10 /* seconds */ + + struct _GdmLocalDisplayFactory + { + GdmDisplayFactory parent; + + GdmDBusLocalDisplayFactory *skeleton; + GDBusConnection *connection; + GHashTable *used_display_numbers; + + /* FIXME: this needs to be per seat? */ + guint num_failures; + + guint seat_new_id; + guint seat_removed_id; + guint seat_properties_changed_id; + + gboolean seat0_graphics_check_timed_out; + guint seat0_graphics_check_timeout_id; + + #if defined(ENABLE_USER_DISPLAY_SERVER) + unsigned int active_vt; + guint active_vt_watch_id; + guint wait_to_finish_timeout_id; + #endif ++ ++ gboolean is_started; + }; + + enum { + PROP_0, + }; + + static void gdm_local_display_factory_class_init (GdmLocalDisplayFactoryClass *klass); + static void gdm_local_display_factory_init (GdmLocalDisplayFactory *factory); + static void gdm_local_display_factory_finalize (GObject *object); + + static void ensure_display_for_seat (GdmLocalDisplayFactory *factory, + const char *seat_id); + + static void on_display_status_changed (GdmDisplay *display, + GParamSpec *arg1, + GdmLocalDisplayFactory *factory); + + static gboolean gdm_local_display_factory_sync_seats (GdmLocalDisplayFactory *factory); + static gpointer local_display_factory_object = NULL; + static gboolean lookup_by_session_id (const char *id, + GdmDisplay *display, + gpointer user_data); + + G_DEFINE_TYPE (GdmLocalDisplayFactory, gdm_local_display_factory, GDM_TYPE_DISPLAY_FACTORY) + + GQuark + gdm_local_display_factory_error_quark (void) + { + static GQuark ret = 0; + if (ret == 0) { +@@ -478,60 +480,64 @@ on_session_registered_cb (GObject *gobject, + GParamSpec *pspec, + gpointer user_data) + { + GdmDisplay *display = GDM_DISPLAY (gobject); + GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (user_data); + gboolean registered; + + g_object_get (display, "session-registered", ®istered, NULL); + + if (!registered) + return; + + g_debug ("GdmLocalDisplayFactory: session registered on display, looking for any background displays to kill"); + + finish_waiting_displays_on_seat (factory, "seat0"); + } + + static void + on_display_status_changed (GdmDisplay *display, + GParamSpec *arg1, + GdmLocalDisplayFactory *factory) + { + int status; + int num; + char *seat_id = NULL; + char *session_type = NULL; + char *session_class = NULL; + gboolean is_initial = TRUE; + gboolean is_local = TRUE; + ++ ++ if (!factory->is_started) ++ return; ++ + num = -1; + gdm_display_get_x11_display_number (display, &num, NULL); + + g_object_get (display, + "seat-id", &seat_id, + "is-initial", &is_initial, + "is-local", &is_local, + "session-type", &session_type, + "session-class", &session_class, + NULL); + + status = gdm_display_get_status (display); + + g_debug ("GdmLocalDisplayFactory: display status changed: %d", status); + switch (status) { + case GDM_DISPLAY_FINISHED: + /* remove the display number from factory->used_display_numbers + so that it may be reused */ + if (num != -1) { + g_hash_table_remove (factory->used_display_numbers, GUINT_TO_POINTER (num)); + } + gdm_display_factory_queue_purge_displays (GDM_DISPLAY_FACTORY (factory)); + + /* if this is a local display, do a full resync. Only + * seats without displays will get created anyway. This + * ensures we get a new login screen when the user logs out, + * if there isn't one. + */ + if (is_local && g_strcmp0 (session_class, "greeter") != 0) { + /* reset num failures */ +@@ -1250,99 +1256,102 @@ on_display_added (GdmDisplayStore *display_store, + + display = gdm_display_store_lookup (display_store, id); + + if (display != NULL) { + g_signal_connect_object (display, "notify::status", + G_CALLBACK (on_display_status_changed), + factory, + 0); + + g_object_weak_ref (G_OBJECT (display), (GWeakNotify)on_display_disposed, factory); + } + } + + static void + on_display_removed (GdmDisplayStore *display_store, + GdmDisplay *display, + GdmLocalDisplayFactory *factory) + { + g_signal_handlers_disconnect_by_func (display, G_CALLBACK (on_display_status_changed), factory); + g_object_weak_unref (G_OBJECT (display), (GWeakNotify)on_display_disposed, factory); + } + + static gboolean + gdm_local_display_factory_start (GdmDisplayFactory *base_factory) + { + GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (base_factory); + GdmDisplayStore *store; + + g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE); + ++ factory->is_started = TRUE; ++ + store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory)); + + g_signal_connect_object (G_OBJECT (store), + "display-added", + G_CALLBACK (on_display_added), + factory, + 0); + + g_signal_connect_object (G_OBJECT (store), + "display-removed", + G_CALLBACK (on_display_removed), + factory, + 0); + + gdm_local_display_factory_start_monitor (factory); + return gdm_local_display_factory_sync_seats (factory); + } + + static gboolean + gdm_local_display_factory_stop (GdmDisplayFactory *base_factory) + { + GdmLocalDisplayFactory *factory = GDM_LOCAL_DISPLAY_FACTORY (base_factory); + GdmDisplayStore *store; + + g_return_val_if_fail (GDM_IS_LOCAL_DISPLAY_FACTORY (factory), FALSE); + + gdm_local_display_factory_stop_monitor (factory); + + store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory)); + + g_signal_handlers_disconnect_by_func (G_OBJECT (store), + G_CALLBACK (on_display_added), + factory); + g_signal_handlers_disconnect_by_func (G_OBJECT (store), + G_CALLBACK (on_display_removed), + factory); +- + g_clear_handle_id (&factory->seat0_graphics_check_timeout_id, g_source_remove); + ++ factory->is_started = FALSE; ++ + return TRUE; + } + + static void + gdm_local_display_factory_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) + { + switch (prop_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + } + + static void + gdm_local_display_factory_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) + { + switch (prop_id) { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + } + } + + static gboolean +diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c +index b3d0a2b5..4b62b8b1 100644 +--- a/daemon/gdm-manager.c ++++ b/daemon/gdm-manager.c +@@ -2774,60 +2774,62 @@ unexport_display (const char *id, + GdmDisplay *display, + GdmManager *manager) + { + if (!g_dbus_connection_is_closed (manager->priv->connection)) + g_dbus_object_manager_server_unexport (manager->priv->object_manager, id); + } + + static void + finish_display (const char *id, + GdmDisplay *display, + GdmManager *manager) + { + gdm_display_stop_greeter_session (display); + if (gdm_display_get_status (display) == GDM_DISPLAY_MANAGED) + gdm_display_unmanage (display); + gdm_display_finish (display); + } + + static void + gdm_manager_dispose (GObject *object) + { + GdmManager *manager; + + g_return_if_fail (object != NULL); + g_return_if_fail (GDM_IS_MANAGER (object)); + + manager = GDM_MANAGER (object); + + g_return_if_fail (manager->priv != NULL); + ++ gdm_manager_stop (manager); ++ + g_clear_weak_pointer (&manager->priv->automatic_login_display); + + #ifdef HAVE_LIBXDMCP + g_clear_object (&manager->priv->xdmcp_factory); + #endif + g_clear_object (&manager->priv->local_factory); + g_clear_pointer (&manager->priv->open_reauthentication_requests, + g_hash_table_unref); + g_clear_pointer (&manager->priv->transient_sessions, + g_hash_table_unref); + + g_list_foreach (manager->priv->user_sessions, + (GFunc) gdm_session_close, + NULL); + g_list_free_full (manager->priv->user_sessions, (GDestroyNotify) g_object_unref); + manager->priv->user_sessions = NULL; + + g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store), + G_CALLBACK (on_display_added), + manager); + g_signal_handlers_disconnect_by_func (G_OBJECT (manager->priv->display_store), + G_CALLBACK (on_display_removed), + manager); + + if (!g_dbus_connection_is_closed (manager->priv->connection)) { + gdm_display_store_foreach (manager->priv->display_store, + (GdmDisplayStoreFunc)unexport_display, + manager); + g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (manager)); + } +-- +2.31.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 2d93f69..f539d6c 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 8c3a382416729296e1d9ba24af6832c354bd6fc4 Mon Sep 17 00:00:00 2001 +From 8451325378ef2981304d96bb27844174dba930c5 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. @@ -22,17 +22,17 @@ PreferredDisplayServer can be set to "wayland", "xorg", "legacy-xorg" or fall back to "wayland". --- common/gdm-settings-keys.h | 2 + - daemon/gdm-display.c | 36 +++++ - daemon/gdm-launch-environment.c | 9 ++ - daemon/gdm-local-display-factory.c | 220 ++++++++++++++++++++++++----- + daemon/gdm-display.c | 36 ++++ + daemon/gdm-launch-environment.c | 9 + + daemon/gdm-local-display-factory.c | 267 ++++++++++++++++++++++++----- daemon/gdm-manager.c | 20 +-- - daemon/gdm-session.c | 143 +++++++++++-------- + daemon/gdm-session.c | 169 ++++++++++-------- data/gdm.schemas.in | 10 ++ - libgdm/gdm-sessions.c | 72 +++++++--- - 8 files changed, 378 insertions(+), 134 deletions(-) + libgdm/gdm-sessions.c | 72 +++++--- + 8 files changed, 437 insertions(+), 148 deletions(-) diff --git a/common/gdm-settings-keys.h b/common/gdm-settings-keys.h -index f0059b5cf..87685d3cd 100644 +index f0059b5c..87685d3c 100644 --- a/common/gdm-settings-keys.h +++ b/common/gdm-settings-keys.h @@ -6,59 +6,61 @@ @@ -98,7 +98,7 @@ index f0059b5cf..87685d3cd 100644 #endif /* _GDM_SETTINGS_KEYS_H */ diff --git a/daemon/gdm-display.c b/daemon/gdm-display.c -index 7c954ad24..874f9e6ba 100644 +index 7c954ad2..bd96dd03 100644 --- a/daemon/gdm-display.c +++ b/daemon/gdm-display.c @@ -66,83 +66,86 @@ typedef struct _GdmDisplayPrivate @@ -583,7 +583,7 @@ index 7c954ad24..874f9e6ba 100644 self); g_signal_handlers_disconnect_by_func (priv->launch_environment, diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c -index feccf057f..5044290cd 100644 +index feccf057..5044290c 100644 --- a/daemon/gdm-launch-environment.c +++ b/daemon/gdm-launch-environment.c @@ -117,60 +117,61 @@ static GHashTable * @@ -718,10 +718,10 @@ index feccf057f..5044290cd 100644 g_signal_emit (G_OBJECT (launch_environment), signals [OPENED], 0); diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c -index 8a4ef06cd..a8ca1d598 100644 +index 8a4ef06c..eba38671 100644 --- a/daemon/gdm-local-display-factory.c +++ b/daemon/gdm-local-display-factory.c -@@ -156,126 +156,221 @@ take_next_display_number (GdmLocalDisplayFactory *factory) +@@ -156,126 +156,287 @@ take_next_display_number (GdmLocalDisplayFactory *factory) g_debug ("GdmLocalDisplayFactory: Found the following X displays:"); for (l = list; l != NULL; l = l->next) { @@ -793,46 +793,107 @@ index 8a4ef06cd..a8ca1d598 100644 + return g_strdup ("none"); +} + ++struct GdmDisplayServerConfiguration { ++ const char *display_server; ++ const char *key; ++ const char *binary; ++ const char *session_type; ++} display_server_configuration[] = { ++#ifdef ENABLE_WAYLAND_SUPPORT ++ { "wayland", GDM_KEY_WAYLAND_ENABLE, "/usr/bin/Xwayland", "wayland" }, ++#endif ++ { "xorg", GDM_KEY_XORG_ENABLE, "/usr/bin/Xorg", "x11" }, ++ { NULL, NULL, NULL }, ++}; ++ ++static gboolean ++display_server_enabled (GdmLocalDisplayFactory *factory, ++ const char *display_server) ++{ ++ size_t i; ++ ++ for (i = 0; display_server_configuration[i].display_server != NULL; i++) { ++ const char *key = display_server_configuration[i].key; ++ const char *binary = display_server_configuration[i].binary; ++ gboolean enabled = FALSE; ++ ++ if (!g_str_equal (display_server_configuration[i].display_server, ++ display_server)) ++ continue; ++ ++ if (!gdm_settings_direct_get_boolean (key, &enabled) || !enabled) ++ return FALSE; ++ ++ if (!g_file_test (binary, G_FILE_TEST_IS_EXECUTABLE)) ++ return FALSE; ++ ++ return TRUE; ++ } ++ ++ return FALSE; ++} ++ +static const char * -+gdm_local_display_factory_get_session_type (GdmLocalDisplayFactory *factory, -+ gboolean should_fall_back) ++get_session_type_for_display_server (GdmLocalDisplayFactory *factory, ++ const char *display_server) ++{ ++ size_t i; ++ ++ for (i = 0; display_server_configuration[i].display_server != NULL; i++) { ++ if (!g_str_equal (display_server_configuration[i].display_server, ++ display_server)) ++ continue; ++ ++ return display_server_configuration[i].session_type; ++ } ++ ++ return NULL; ++} ++ ++static char ** ++gdm_local_display_factory_get_session_types (GdmLocalDisplayFactory *factory, ++ gboolean should_fall_back) +{ -+ const char *session_types[3] = { NULL }; -+ gsize i, session_type_index = 0, number_of_session_types = 0; + g_autofree gchar *preferred_display_server = NULL; ++ const char *fallback_display_server = NULL; ++ gboolean wayland_preferred = FALSE; ++ gboolean xorg_preferred = FALSE; ++ g_autoptr (GPtrArray) session_types_array = NULL; ++ char **session_types; ++ ++ session_types_array = g_ptr_array_new (); ++ + preferred_display_server = get_preferred_display_server (factory); -+ if (g_strcmp0 (preferred_display_server, "wayland") != 0 && -+ g_strcmp0 (preferred_display_server, "xorg") != 0) -+ return NULL; -+ for (i = 0; i < G_N_ELEMENTS (session_types) - 1; i++) { -+#ifdef ENABLE_WAYLAND_SUPPORT -+ if (number_of_session_types > 0 || -+ g_strcmp0 (preferred_display_server, "wayland") == 0) { -+ gboolean wayland_enabled = FALSE; -+ if (gdm_settings_direct_get_boolean (GDM_KEY_WAYLAND_ENABLE, &wayland_enabled)) { -+ if (wayland_enabled && g_file_test ("/usr/bin/Xwayland", G_FILE_TEST_IS_EXECUTABLE)) { -+ session_types[i] = "wayland"; -+ number_of_session_types++; -+ continue; -+ } -+ } -+ } -+#endif -+ if (number_of_session_types > 0 || -+ g_strcmp0 (preferred_display_server, "xorg") == 0) { -+ gboolean xorg_enabled = FALSE; -+ if (gdm_settings_direct_get_boolean (GDM_KEY_XORG_ENABLE, &xorg_enabled)) { -+ if (xorg_enabled && g_file_test ("/usr/bin/Xorg", G_FILE_TEST_IS_EXECUTABLE)) { -+ session_types[i] = "x11"; -+ number_of_session_types++; -+ continue; -+ } -+ } -+ } ++ ++ g_debug ("GdmLocalDisplayFactory: Getting session type (prefers %s, falling back: %s)", ++ preferred_display_server, should_fall_back? "yes" : "no"); ++ ++ wayland_preferred = g_str_equal (preferred_display_server, "wayland"); ++ xorg_preferred = g_str_equal (preferred_display_server, "xorg"); ++ ++ if (wayland_preferred) ++ fallback_display_server = "xorg"; ++ else if (xorg_preferred) ++ fallback_display_server = "wayland"; ++ else ++ return NULL; ++ ++ if (!should_fall_back) { ++ if (display_server_enabled (factory, preferred_display_server)) ++ g_ptr_array_add (session_types_array, (gpointer) get_session_type_for_display_server (factory, preferred_display_server)); + } -+ if (should_fall_back) -+ session_type_index++; -+ return session_types[session_type_index]; ++ ++ if (display_server_enabled (factory, fallback_display_server)) ++ g_ptr_array_add (session_types_array, (gpointer) get_session_type_for_display_server (factory, fallback_display_server)); ++ ++ if (session_types_array->len == 0) ++ return NULL; ++ ++ g_ptr_array_add (session_types_array, NULL); ++ ++ session_types = g_strdupv ((char **) session_types_array->pdata); ++ ++ return session_types; +} + static void @@ -903,9 +964,11 @@ index 8a4ef06cd..a8ca1d598 100644 +#ifdef ENABLE_USER_DISPLAY_SERVER + if (g_strcmp0 (preferred_display_server, "wayland") == 0 || + g_strcmp0 (preferred_display_server, "xorg") == 0) { -+ session_type = gdm_local_display_factory_get_session_type (factory, FALSE); ++ g_auto(GStrv) session_types = NULL; + -+ if (session_type == NULL) { ++ session_types = gdm_local_display_factory_get_session_types (factory, FALSE); ++ ++ if (session_types == NULL) { + g_set_error_literal (error, + GDM_DISPLAY_ERROR, + GDM_DISPLAY_ERROR_GENERAL, @@ -915,7 +978,10 @@ index 8a4ef06cd..a8ca1d598 100644 - display = gdm_legacy_display_new (num); + display = gdm_local_display_new (); -+ g_object_set (G_OBJECT (display), "session-type", session_type, NULL); ++ g_object_set (G_OBJECT (display), ++ "session-type", session_types[0], ++ "supported-session-tyes", session_types, ++ NULL); + is_initial = TRUE; } #endif @@ -966,7 +1032,11 @@ index 8a4ef06cd..a8ca1d598 100644 static void finish_display_on_seat_if_waiting (GdmDisplayStore *display_store, GdmDisplay *display, -@@ -454,190 +549,239 @@ lookup_prepared_display_by_seat_id (const char *id, +@@ -450,194 +611,220 @@ lookup_prepared_display_by_seat_id (const char *id, + + if (status != GDM_DISPLAY_PREPARED) + return FALSE; + return lookup_by_seat_id (id, display, user_data); } @@ -993,7 +1063,9 @@ index 8a4ef06cd..a8ca1d598 100644 int ret; gboolean seat_supports_graphics; gboolean is_seat0; - const char *session_type = "wayland"; +- const char *session_type = "wayland"; ++ g_auto (GStrv) session_types = NULL; ++ const char *legacy_session_types[] = { "x11", NULL }; GdmDisplayStore *store; GdmDisplay *display = NULL; g_autofree char *login_session_id = NULL; @@ -1038,10 +1110,10 @@ index 8a4ef06cd..a8ca1d598 100644 - g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use wayland"); - } + falling_back = factory->num_failures > 0; -+ session_type = gdm_local_display_factory_get_session_type (factory, falling_back); ++ session_types = gdm_local_display_factory_get_session_types (factory, falling_back); + + g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s", -+ session_type, falling_back? " fallback" : ""); ++ session_types[0], falling_back? " fallback" : ""); } else { is_seat0 = FALSE; @@ -1049,7 +1121,7 @@ index 8a4ef06cd..a8ca1d598 100644 /* Force legacy X11 for all auxiliary seats */ seat_supports_graphics = TRUE; - session_type = NULL; -+ session_type = "x11"; ++ session_types = g_strdupv ((char **) legacy_session_types); } /* For seat0, we have a fallback logic to still try starting it after @@ -1088,8 +1160,9 @@ index 8a4ef06cd..a8ca1d598 100644 g_debug ("GdmLocalDisplayFactory: This might indicate an issue where the framebuffer device is not tagged as master-of-seat in udev."); seat_supports_graphics = TRUE; - session_type = NULL; -+ session_type = "x11"; + wayland_enabled = FALSE; ++ g_strfreev (session_types); ++ session_types = g_strdupv ((char **) legacy_session_types); } else { g_clear_handle_id (&factory->seat0_graphics_check_timeout_id, g_source_remove); } @@ -1100,9 +1173,9 @@ index 8a4ef06cd..a8ca1d598 100644 - g_debug ("GdmLocalDisplayFactory: %s login display for seat %s requested", - session_type? : "X11", seat_id); -+ if (session_type != NULL) ++ if (session_types != NULL) + g_debug ("GdmLocalDisplayFactory: %s login display for seat %s requested", -+ session_type, seat_id); ++ session_types[0], seat_id); + else if (g_strcmp0 (preferred_display_server, "legacy-xorg") == 0) + g_debug ("GdmLocalDisplayFactory: Legacy Xorg login display for seat %s requested", + seat_id); @@ -1144,53 +1217,29 @@ index 8a4ef06cd..a8ca1d598 100644 - if (is_seat0) { - display = gdm_local_display_new (); - if (session_type != NULL) { +- g_object_set (G_OBJECT (display), "session-type", session_type, NULL); + if (g_strcmp0 (preferred_display_server, "wayland") == 0 || + g_strcmp0 (preferred_display_server, "xorg") == 0) { + if (is_seat0) { -+ g_autoptr (GPtrArray) supported_session_types = NULL; -+ -+ if (session_type == NULL) { -+ g_warning ("GdmLocalDisplayFactory: Both Wayland and Xorg sessions are unavailable"); -+ return; -+ } -+ -+ supported_session_types = g_ptr_array_new (); -+ -+ if (g_strcmp0 (preferred_display_server, "wayland") == 0) { -+ if (wayland_enabled) -+ g_ptr_array_add (supported_session_types, "wayland"); -+ } else { -+ if (xorg_enabled) -+ g_ptr_array_add (supported_session_types, "x11"); -+ } -+ -+ if (!falling_back) { -+ if (g_strcmp0 (preferred_display_server, "wayland") == 0) { -+ if (xorg_enabled) -+ g_ptr_array_add (supported_session_types, "x11"); -+ } else { -+ if (wayland_enabled) -+ g_ptr_array_add (supported_session_types, "wayland"); -+ } -+ } -+ -+ g_ptr_array_add (supported_session_types, NULL); -+ + display = gdm_local_display_new (); - g_object_set (G_OBJECT (display), "session-type", session_type, NULL); -+ g_object_set (G_OBJECT (display), "supported-session-types", supported_session_types->pdata, NULL); ++ g_object_set (G_OBJECT (display), ++ "session-type", session_types[0], ++ "supported-session-types", session_types, ++ NULL); } } #endif if (display == NULL) { guint32 num; -+ const char *supported_session_types[] = { "x11", NULL }; num = take_next_display_number (factory); display = gdm_legacy_display_new (num); -+ g_object_set (G_OBJECT (display), "supported-session-types", supported_session_types, NULL); ++ g_object_set (G_OBJECT (display), ++ "session-type", legacy_session_types[0], ++ "supported-session-types", legacy_session_types, ++ NULL); } g_object_set (display, "seat-id", seat_id, NULL); @@ -1222,7 +1271,7 @@ index 8a4ef06cd..a8ca1d598 100644 static gboolean diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c -index 9c10adff3..24219691c 100644 +index 9c10adff..24219691 100644 --- a/daemon/gdm-manager.c +++ b/daemon/gdm-manager.c @@ -1306,74 +1306,75 @@ get_automatic_login_details (GdmManager *manager, @@ -1461,7 +1510,7 @@ index 9c10adff3..24219691c 100644 } diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c -index 5c5903a49..a53fb9804 100644 +index 5c5903a4..7b0ade1e 100644 --- a/daemon/gdm-session.c +++ b/daemon/gdm-session.c @@ -105,100 +105,98 @@ struct _GdmSession @@ -1666,14 +1715,14 @@ index 5c5903a49..a53fb9804 100644 - } + for (j = 0; self->supported_session_types[j] != NULL; j++) { + const char *supported_type = self->supported_session_types[j]; -+ + +- g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs)); + if (g_str_equal (supported_type, "x11")) { + for (i = 0; system_data_dirs[i]; i++) { + gchar *dir = g_build_filename (system_data_dirs[i], "xsessions", NULL); + g_array_append_val (search_array, dir); + } - -- g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs)); ++ + g_array_append_vals (search_array, x_search_dirs, G_N_ELEMENTS (x_search_dirs)); + } @@ -1817,7 +1866,94 @@ index 5c5903a49..a53fb9804 100644 if (WIFEXITED (status)) { g_debug ("GdmSession: Emitting 'session-exited' signal with exit code '%d'", -@@ -2197,68 +2203,72 @@ close_conversation (GdmSessionConversation *conversation) +@@ -968,73 +974,76 @@ worker_on_reauthenticated (GdmDBusWorker *worker, + static void + worker_on_saved_language_name_read (GdmDBusWorker *worker, + const char *language_name, + GdmSessionConversation *conversation) + { + GdmSession *self = conversation->session; + + if (strlen (language_name) > 0) { + g_free (self->saved_language); + self->saved_language = g_strdup (language_name); + + if (self->greeter_interface != NULL) { + gdm_dbus_greeter_emit_default_language_name_changed (self->greeter_interface, + language_name); + } + } + } + + static void + worker_on_saved_session_name_read (GdmDBusWorker *worker, + const char *session_name, + GdmSessionConversation *conversation) + { + GdmSession *self = conversation->session; + + if (! get_session_command_for_name (self, session_name, NULL)) { + /* ignore sessions that don't exist */ + g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name); + g_free (self->saved_session); + self->saved_session = NULL; +- } else if (strcmp (session_name, +- get_default_session_name (self)) != 0) { +- g_free (self->saved_session); +- self->saved_session = g_strdup (session_name); +- +- if (self->greeter_interface != NULL) { +- gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface, +- session_name); ++ update_session_type (self); ++ } else { ++ if (strcmp (session_name, ++ get_default_session_name (self)) != 0) { ++ g_free (self->saved_session); ++ self->saved_session = g_strdup (session_name); ++ ++ if (self->greeter_interface != NULL) { ++ gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface, ++ session_name); ++ } + } ++ if (self->saved_session_type != NULL) ++ set_session_type (self, self->saved_session_type); + } + +- update_session_type (self); +- + } + + static GdmSessionConversation * + find_conversation_by_pid (GdmSession *self, + GPid pid) + { + GHashTableIter iter; + gpointer key, value; + + g_hash_table_iter_init (&iter, self->conversations); + while (g_hash_table_iter_next (&iter, &key, &value)) { + GdmSessionConversation *conversation; + + conversation = (GdmSessionConversation *) value; + + if (conversation->worker_pid == pid) { + return conversation; + } + } + + return NULL; + } + + static gboolean + allow_worker_function (GDBusAuthObserver *observer, + GIOStream *stream, + GCredentials *credentials, + GdmSession *self) + { + uid_t connecting_user; +@@ -2197,68 +2206,72 @@ close_conversation (GdmSessionConversation *conversation) if (conversation->worker_manager_interface != NULL) { unexport_worker_manager_interface (self, conversation->worker_manager_interface); @@ -1895,7 +2031,7 @@ index 5c5903a49..a53fb9804 100644 g_hash_table_insert (self->conversations, g_strdup (service_name), conversation); return TRUE; -@@ -3137,64 +3147,66 @@ gdm_session_get_conversation_session_id (GdmSession *self, +@@ -3137,64 +3150,66 @@ gdm_session_get_conversation_session_id (GdmSession *self, conversation = find_conversation_by_name (self, service_name); @@ -1965,7 +2101,63 @@ index 5c5903a49..a53fb9804 100644 } gboolean -@@ -3479,140 +3491,138 @@ gdm_session_set_property (GObject *object, +@@ -3424,195 +3439,192 @@ set_display_is_initial (GdmSession *self, + { + self->display_is_initial = is_initial; + } + + static void + set_verification_mode (GdmSession *self, + GdmSessionVerificationMode verification_mode) + { + self->verification_mode = verification_mode; + } + + static void + set_allowed_user (GdmSession *self, + uid_t allowed_user) + { + self->allowed_user = allowed_user; + } + + static void + set_conversation_environment (GdmSession *self, + char **environment) + { + g_strfreev (self->conversation_environment); + self->conversation_environment = g_strdupv (environment); + } + + static void + set_session_type (GdmSession *self, + const char *session_type) + { +- ++ g_debug ("GdmSession: setting session to type '%s'", session_type? session_type : ""); + if (g_strcmp0 (self->session_type, session_type) != 0) { +- g_debug ("GdmSession: setting session to type '%s'", session_type? session_type : ""); + g_free (self->session_type); + self->session_type = g_strdup (session_type); + } + } + + static void + gdm_session_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) + { + GdmSession *self; + + self = GDM_SESSION (object); + + switch (prop_id) { + case PROP_SESSION_TYPE: + set_session_type (self, g_value_get_string (value)); + break; + case PROP_DISPLAY_NAME: + set_display_name (self, g_value_get_string (value)); + break; case PROP_DISPLAY_HOSTNAME: set_display_hostname (self, g_value_get_string (value)); break; @@ -2112,7 +2304,7 @@ index 5c5903a49..a53fb9804 100644 if (self->worker_server != NULL) { g_dbus_server_stop (self->worker_server); -@@ -3719,60 +3729,71 @@ gdm_session_class_init (GdmSessionClass *session_class) +@@ -3719,60 +3731,71 @@ gdm_session_class_init (GdmSessionClass *session_class) NULL, NULL, NULL, @@ -2184,7 +2376,7 @@ index 5c5903a49..a53fb9804 100644 0, NULL, NULL, -@@ -3962,69 +3983,67 @@ gdm_session_class_init (GdmSessionClass *session_class) +@@ -3962,69 +3985,67 @@ gdm_session_class_init (GdmSessionClass *session_class) PROP_DISPLAY_X11_AUTHORITY_FILE, g_param_spec_string ("display-x11-authority-file", "display x11 authority file", @@ -2261,7 +2453,7 @@ index 5c5903a49..a53fb9804 100644 NULL); diff --git a/data/gdm.schemas.in b/data/gdm.schemas.in -index 255bff023..a1035f95e 100644 +index 255bff02..a1035f95 100644 --- a/data/gdm.schemas.in +++ b/data/gdm.schemas.in @@ -25,65 +25,75 @@ @@ -2341,7 +2533,7 @@ index 255bff023..a1035f95e 100644 xdmcp/MaxPending i diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c -index 75d442eeb..97ed5ef3d 100644 +index 75d442ee..97ed5ef3 100644 --- a/libgdm/gdm-sessions.c +++ b/libgdm/gdm-sessions.c @@ -163,171 +163,203 @@ load_session_file (const char *id, @@ -2569,5 +2761,5 @@ index 75d442eeb..97ed5ef3d 100644 while (g_hash_table_iter_next (&iter, &key, &value)) { GdmSessionFile *session; -- -2.31.1 +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 deleted file mode 100644 index 81d88ac..0000000 --- a/SOURCES/0001-local-display-factory-pause-for-a-few-seconds-before.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 5c52259331ce0b37dd1b2b092ff41f96b0e5ce64 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 - -logind currently gets confused if a session is started immediately as -one is shutting down. - -Workaround this problem by adding an artificial delay when falling -back to X. - -http://bugzilla.redhat.com/1643874 ---- - daemon/gdm-local-display-factory.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c -index 0bb3851f1..297c3ac80 100644 ---- a/daemon/gdm-local-display-factory.c -+++ b/daemon/gdm-local-display-factory.c -@@ -586,60 +586,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; - } - - 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_type = gdm_local_display_factory_get_session_type (factory, falling_back); - - g_debug ("GdmLocalDisplayFactory: New displays on seat0 will use %s%s", - session_type, falling_back? " fallback" : ""); -+ -+ if (falling_back) { -+ /* workaround logind race for now -+ * bug 1643874 -+ */ -+ g_usleep (2 * G_USEC_PER_SEC); -+ } - } 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_type = "x11"; - } - - /* 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.30.1 - diff --git a/SOURCES/0001-meson-Fix-detection-of-Xorg-versions-that-need-liste.patch b/SOURCES/0001-meson-Fix-detection-of-Xorg-versions-that-need-liste.patch new file mode 100644 index 0000000..1250e74 --- /dev/null +++ b/SOURCES/0001-meson-Fix-detection-of-Xorg-versions-that-need-liste.patch @@ -0,0 +1,144 @@ +From f101371f418bb0013af1e5e1ef522277011fd48d Mon Sep 17 00:00:00 2001 +From: Alan Coopersmith +Date: Thu, 7 Oct 2021 18:22:11 -0700 +Subject: [PATCH 1/2] meson: Fix detection of Xorg versions that need -listen + tcp + +Closes #704 +--- + meson.build | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/meson.build b/meson.build +index e6fcf4b8..06d09659 100644 +--- a/meson.build ++++ b/meson.build +@@ -42,60 +42,63 @@ udev_dep = dependency('udev') + glib_min_version = '2.56.0' + + glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version) + gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version) + gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version) + gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version) + gtk_dep = dependency('gtk+-3.0', version: '>= 2.91.1') + libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>= 0.4') + accountsservice_dep = dependency('accountsservice', version: '>= 0.6.35') + xcb_dep = dependency('xcb') + keyutils_dep = dependency('libkeyutils', required: false) + libselinux_dep = dependency('libselinux', required: get_option('selinux')) + + # udev + if udev_dir == '' + if udev_dep.found() + udev_prefix = udev_dep.get_pkgconfig_variable('udevdir') + else + udev_prefix = gdm_prefix / 'lib' / 'udev' + endif + udev_dir = udev_prefix / 'rules.d' + endif + + # X11 + x_deps = declare_dependency( + dependencies: [ + dependency('x11'), + dependency('xau'), + ], + ) ++# Xserver 1.17 & later default to -nolisten and require -listen for remote access ++xserver_deps = dependency('xorg-server', version : '>=1.17', required : false) ++xserver_nolisten_default = xserver_deps.found() + find_x_server_script = find_program('build-aux/find-x-server.sh', native: true) + find_x_server_out = run_command(find_x_server_script).stdout().strip() + if find_x_server_out != '' + x_bin = find_x_server_out + x_bin_path_split = x_bin.split('/') + i = 0 + x_path = '/' + foreach dir : x_bin_path_split + if i < x_bin_path_split.length() - 1 + x_path = x_path / dir + endif + i = i + 1 + endforeach + else + # what to do, what to do, this is wrong, but this just sets the + # defaults, perhaps this user is cross compiling or some such + x_path = '/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin' + x_bin = '/usr/bin/X' + endif + xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp')) + if xdmcp_dep.found() and get_option('tcp-wrappers') + libwrap_dep = cc.find_library('libwrap') + endif + # systemd + systemd_dep = dependency('systemd') + libsystemd_dep = dependency('libsystemd') + if meson.version().version_compare('>= 0.53') + systemd_multiseat_x = find_program('systemd-multi-seat-x', + required: false, + dirs: [ +@@ -197,60 +200,61 @@ conf.set_quoted('SYSCONFDIR', gdm_prefix / get_option('sysconfdir')) + conf.set_quoted('BINDIR', gdm_prefix / get_option('bindir')) + conf.set_quoted('LIBDIR', gdm_prefix / get_option('libdir')) + conf.set_quoted('LIBEXECDIR', gdm_prefix / get_option('libexecdir')) + conf.set_quoted('LOGDIR', get_option('log-dir')) + conf.set_quoted('DMCONFDIR', dmconfdir) + conf.set_quoted('GDMCONFDIR', gdmconfdir) + conf.set_quoted('GDM_SCREENSHOT_DIR', gdm_screenshot_dir) + conf.set_quoted('GDM_XAUTH_DIR', gdm_xauth_dir) + conf.set_quoted('GDM_RAN_ONCE_MARKER_DIR', ran_once_marker_dir) + conf.set_quoted('GDM_RUN_DIR', gdm_run_dir) + conf.set_quoted('GNOMELOCALEDIR', gdm_prefix / get_option('localedir')) + conf.set_quoted('AT_SPI_REGISTRYD_DIR', at_spi_registryd_dir) + conf.set_quoted('GDM_PID_FILE', gdm_pid_file) + conf.set_quoted('GNOME_SETTINGS_DAEMON_DIR', gnome_settings_daemon_dir) + conf.set_quoted('LANG_CONFIG_FILE', lang_config_file) + conf.set('HAVE_ADT', have_adt) + conf.set('HAVE_UTMP_H', have_utmp_header) + conf.set('HAVE_UTMPX_H', have_utmpx_header) + conf.set('HAVE_POSIX_GETPWNAM_R', have_posix_getpwnam_r) + conf.set('UTMP', utmp_struct) + conf.set('HAVE_GETUTXENT', cc.has_function('getutxent')) + conf.set('HAVE_UPDWTMP', cc.has_function('updwtmp')) + conf.set('HAVE_UPDWTMPX', cc.has_function('updwtmpx')) + conf.set('HAVE_LOGIN', cc.has_function('login', args: '-lutil')) + conf.set('HAVE_LOGOUT', cc.has_function('logout', args: '-lutil')) + conf.set('HAVE_LOGWTMP', cc.has_function('logwtmp', args: '-lutil')) + conf.set('HAVE_PAM_SYSLOG', have_pam_syslog) + conf.set('HAVE_KEYUTILS', keyutils_dep.found()) + conf.set('SUPPORTS_PAM_EXTENSIONS', pam_extensions_supported) + conf.set('HAVE_SELINUX', libselinux_dep.found()) ++conf.set('HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY', xserver_nolisten_default) + conf.set('ENABLE_USER_DISPLAY_SERVER', get_option('user-display-server')) + conf.set('ENABLE_SYSTEMD_JOURNAL', get_option('systemd-journal')) + conf.set('ENABLE_WAYLAND_SUPPORT', get_option('wayland-support')) + conf.set('ENABLE_PROFILING', get_option('profiling')) + conf.set('GDM_INITIAL_VT', get_option('initial-vt')) + conf.set_quoted('GDM_DEFAULTS_CONF', gdm_defaults_conf) + conf.set_quoted('GDM_CUSTOM_CONF', gdm_custom_conf) + conf.set_quoted('GDM_RUNTIME_CONF', gdm_runtime_conf) + conf.set_quoted('GDM_SESSION_DEFAULT_PATH', get_option('default-path')) + conf.set_quoted('GDM_USERNAME', get_option('user')) + conf.set_quoted('GDM_GROUPNAME', get_option('group')) + conf.set('HAVE_LIBXDMCP', xdmcp_dep.found()) + conf.set_quoted('SYSTEMD_X_SERVER', systemd_x_server) + conf.set('WITH_PLYMOUTH', plymouth_dep.found()) + conf.set_quoted('X_SERVER', x_bin) + conf.set_quoted('X_PATH', x_path) + conf.set('HAVE_UT_UT_HOST', utmp_has_host_field) + conf.set('HAVE_UT_UT_PID', utmp_has_pid_field) + conf.set('HAVE_UT_UT_ID', utmp_has_id_field) + conf.set('HAVE_UT_UT_NAME', utmp_has_name_field) + conf.set('HAVE_UT_UT_TYPE', utmp_has_type_field) + conf.set('HAVE_UT_UT_EXIT_E_TERMINATION', utmp_has_exit_e_termination_field) + conf.set('HAVE_UT_UT_USER', utmp_has_user_field) + conf.set('HAVE_UT_UT_TIME', utmp_has_time_field) + conf.set('HAVE_UT_UT_TV', utmp_has_tv_field) + conf.set('HAVE_UT_UT_SYSLEN', utmp_has_syslen_field) + conf.set('ENABLE_IPV6', get_option('ipv6')) + configure_file(output: 'config.h', configuration: conf) + + # Subdirs +-- +2.33.1 + diff --git a/SOURCES/0001-session-worker-Set-session_vt-0-out-of-pam-uninitial.patch b/SOURCES/0001-session-worker-Set-session_vt-0-out-of-pam-uninitial.patch new file mode 100644 index 0000000..5a403d6 --- /dev/null +++ b/SOURCES/0001-session-worker-Set-session_vt-0-out-of-pam-uninitial.patch @@ -0,0 +1,84 @@ +From 56d12ad9697d5695c780a5be0065d23fec6bd1a5 Mon Sep 17 00:00:00 2001 +From: Chingkai Chu <3013329+chuchingkai@users.noreply.github.com> +Date: Thu, 12 Aug 2021 10:34:01 +0800 +Subject: [PATCH] session-worker: Set session_vt=0 out of pam uninitialization + +MR GNOME/gdm!123 moved jump_to_vt and session_vt reseting to a +separate function, so we don't need to reset session_vt in pam +uninitialization. + +https://gitlab.gnome.org/GNOME/gdm/-/issues/719 +--- + daemon/gdm-session-worker.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c +index c1201b70..9cff53a5 100644 +--- a/daemon/gdm-session-worker.c ++++ b/daemon/gdm-session-worker.c +@@ -1076,62 +1076,60 @@ gdm_session_worker_set_state (GdmSessionWorker *worker, + + static void + gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker, + int status) + { + g_debug ("GdmSessionWorker: uninitializing PAM"); + + if (worker->priv->pam_handle == NULL) + return; + + gdm_session_worker_get_username (worker, NULL); + + if (worker->priv->state >= GDM_SESSION_WORKER_STATE_SESSION_OPENED) { + pam_close_session (worker->priv->pam_handle, 0); + gdm_session_auditor_report_logout (worker->priv->auditor); + } else { + gdm_session_auditor_report_login_failure (worker->priv->auditor, + status, + pam_strerror (worker->priv->pam_handle, status)); + } + + if (worker->priv->state >= GDM_SESSION_WORKER_STATE_ACCREDITED) { + pam_setcred (worker->priv->pam_handle, PAM_DELETE_CRED); + } + + pam_end (worker->priv->pam_handle, status); + worker->priv->pam_handle = NULL; + + gdm_session_worker_stop_auditor (worker); + +- worker->priv->session_vt = 0; +- + g_debug ("GdmSessionWorker: state NONE"); + gdm_session_worker_set_state (worker, GDM_SESSION_WORKER_STATE_NONE); + } + + static char * + _get_tty_for_pam (const char *x11_display_name, + const char *display_device) + { + #ifdef __sun + return g_strdup (display_device); + #else + return g_strdup (x11_display_name); + #endif + } + + #ifdef PAM_XAUTHDATA + static struct pam_xauth_data * + _get_xauth_for_pam (const char *x11_authority_file) + { + FILE *fh; + Xauth *auth = NULL; + struct pam_xauth_data *retval = NULL; + gsize len = sizeof (*retval) + 1; + + fh = fopen (x11_authority_file, "r"); + if (fh) { + auth = XauReadAuth (fh); + fclose (fh); + } + if (auth) { +-- +2.31.1 + diff --git a/SOURCES/0001-worker-don-t-load-user-settings-for-program-sessions.patch b/SOURCES/0001-worker-don-t-load-user-settings-for-program-sessions.patch index f847682..82ba705 100644 --- a/SOURCES/0001-worker-don-t-load-user-settings-for-program-sessions.patch +++ b/SOURCES/0001-worker-don-t-load-user-settings-for-program-sessions.patch @@ -1,4 +1,4 @@ -From 7edce4ef248af01692758caf9dbb945bdd45cb0f Mon Sep 17 00:00:00 2001 +From f0dce28fa02210caa445e96d9cbec1d150b79e80 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 15 Aug 2018 10:48:16 -0400 Subject: [PATCH 1/4] worker: don't load user settings for program sessions @@ -10,7 +10,7 @@ for its session name 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c -index 774298b95..88fe36c16 100644 +index 9b8e0d87..438348df 100644 --- a/daemon/gdm-session-worker.c +++ b/daemon/gdm-session-worker.c @@ -400,103 +400,108 @@ gdm_session_execute (const char *file, @@ -124,7 +124,7 @@ index 774298b95..88fe36c16 100644 worker->priv->service, question, answerp, -@@ -2600,87 +2605,89 @@ gdm_session_worker_get_property (GObject *object, +@@ -2598,87 +2603,89 @@ gdm_session_worker_get_property (GObject *object, g_value_set_boolean (value, self->priv->is_reauth_session); break; case PROP_STATE: @@ -218,7 +218,7 @@ index 774298b95..88fe36c16 100644 g_free (session_name); } -@@ -2758,110 +2765,113 @@ do_authorize (GdmSessionWorker *worker) +@@ -2756,110 +2763,113 @@ do_authorize (GdmSessionWorker *worker) g_dbus_method_invocation_take_error (worker->priv->pending_invocation, error); } worker->priv->pending_invocation = NULL; @@ -336,7 +336,7 @@ index 774298b95..88fe36c16 100644 } gdm_dbus_worker_complete_open (GDM_DBUS_WORKER (worker), worker->priv->pending_invocation, session_id); -@@ -3105,155 +3115,161 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object, +@@ -3103,155 +3113,161 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object, if (g_strcmp0 (key, "service") == 0) { worker->priv->service = g_variant_dup_string (value, NULL); } else if (g_strcmp0 (key, "extensions") == 0) { @@ -498,7 +498,7 @@ index 774298b95..88fe36c16 100644 GDBusMethodInvocation *invocation, const char *service, const char *username, -@@ -3591,61 +3607,60 @@ static void +@@ -3589,61 +3605,60 @@ static void reauthentication_request_free (ReauthenticationRequest *request) { @@ -561,5 +561,5 @@ index 774298b95..88fe36c16 100644 g_return_if_fail (worker->priv != NULL); -- -2.31.1 +2.33.1 diff --git a/SOURCES/0002-daemon-Support-X-servers-built-with-Dlisten_tcp-true.patch b/SOURCES/0002-daemon-Support-X-servers-built-with-Dlisten_tcp-true.patch new file mode 100644 index 0000000..e4bd561 --- /dev/null +++ b/SOURCES/0002-daemon-Support-X-servers-built-with-Dlisten_tcp-true.patch @@ -0,0 +1,327 @@ +From d3823a5084e12d8f342fd4cbec29e23bdb646de7 Mon Sep 17 00:00:00 2001 +From: Alan Coopersmith +Date: Thu, 7 Oct 2021 18:22:11 -0700 +Subject: [PATCH 2/2] daemon: Support X servers built with -Dlisten_tcp=true + +Xorg since version 1.17 doesn't listen to tcp sockets by default +unless it's explicitly built with -Dlisten_tcp=true. + +GDM currently assumes X servers 1.17 and later are always built +without specifying -Dlisten_tcp=true and doesn't work properly +otherwise. + +This commit enhances GDM to better handle these non-standard builds by +always passing '-nolisten tcp' on the command line when tcp should +be disabled, and likewise always passing '-listen tcp' on the command +line, assuming the X server is new enough to support it, when tcp +should be enabled. + +Related #704 +--- + daemon/gdm-server.c | 21 +++++++++++---------- + daemon/gdm-x-session.c | 12 ++++++------ + meson.build | 4 ++-- + 3 files changed, 19 insertions(+), 18 deletions(-) + +diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c +index 1ba00d45..e5d23521 100644 +--- a/daemon/gdm-server.c ++++ b/daemon/gdm-server.c +@@ -290,72 +290,73 @@ gdm_server_resolve_command_line (GdmServer *server, + if (strcmp (arg, "-query") == 0 || + strcmp (arg, "-indirect") == 0) + query_in_arglist = TRUE; + } + + argv = g_renew (char *, argv, len + 12); + /* shift args down one */ + for (i = len - 1; i >= 1; i--) { + argv[i+1] = argv[i]; + } + + /* server number is the FIRST argument, before any others */ + argv[1] = g_strdup (server->display_name); + len++; + + if (server->auth_file != NULL) { + argv[len++] = g_strdup ("-auth"); + argv[len++] = g_strdup (server->auth_file); + } + + if (server->display_seat_id != NULL) { + argv[len++] = g_strdup ("-seat"); + argv[len++] = g_strdup (server->display_seat_id); + } + + /* If we were compiled with Xserver >= 1.17 we need to specify + * '-listen tcp' as the X server dosen't listen on tcp sockets + * by default anymore. In older versions we need to pass + * -nolisten tcp to disable listening on tcp sockets. + */ +-#ifdef HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY +- if (!server->disable_tcp && ! query_in_arglist) { +- argv[len++] = g_strdup ("-listen"); +- argv[len++] = g_strdup ("tcp"); +- } +-#else +- if (server->disable_tcp && ! query_in_arglist) { +- argv[len++] = g_strdup ("-nolisten"); +- argv[len++] = g_strdup ("tcp"); +- } ++ if (!query_in_arglist) { ++ if (server->disable_tcp) { ++ argv[len++] = g_strdup ("-nolisten"); ++ argv[len++] = g_strdup ("tcp"); ++ } + ++#ifdef HAVE_XSERVER_WITH_LISTEN ++ if (!server->disable_tcp) { ++ argv[len++] = g_strdup ("-listen"); ++ argv[len++] = g_strdup ("tcp"); ++ } + #endif ++ } + + if (vtarg != NULL && ! gotvtarg) { + argv[len++] = g_strdup (vtarg); + } + + argv[len++] = NULL; + + *argvp = argv; + *argcp = len; + + return TRUE; + } + + static void + rotate_logs (const char *path, + guint n_copies) + { + int i; + + for (i = n_copies - 1; i > 0; i--) { + char *name_n; + char *name_n1; + + name_n = g_strdup_printf ("%s.%d", path, i); + if (i > 1) { + name_n1 = g_strdup_printf ("%s.%d", path, i - 1); + } else { + name_n1 = g_strdup (path); + } + +diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c +index b1548361..d2a8aeb3 100644 +--- a/daemon/gdm-x-session.c ++++ b/daemon/gdm-x-session.c +@@ -233,70 +233,70 @@ spawn_x_server (State *state, + + if (g_getenv ("XDG_VTNR") != NULL) { + int vt; + + vt = atoi (g_getenv ("XDG_VTNR")); + + if (vt > 0 && vt < 64) { + vt_string = g_strdup_printf ("vt%d", vt); + } + } + + display_fd_string = g_strdup_printf ("%d", DISPLAY_FILENO); + + g_ptr_array_add (arguments, X_SERVER); + + if (vt_string != NULL) { + g_ptr_array_add (arguments, vt_string); + } + + g_ptr_array_add (arguments, "-displayfd"); + g_ptr_array_add (arguments, display_fd_string); + + g_ptr_array_add (arguments, "-auth"); + g_ptr_array_add (arguments, auth_file); + + /* If we were compiled with Xserver >= 1.17 we need to specify + * '-listen tcp' as the X server doesn't listen on tcp sockets + * by default anymore. In older versions we need to pass + * -nolisten tcp to disable listening on tcp sockets. + */ +-#ifdef HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY +- if (allow_remote_connections) { +- g_ptr_array_add (arguments, "-listen"); +- g_ptr_array_add (arguments, "tcp"); +- } +-#else + if (!allow_remote_connections) { + g_ptr_array_add (arguments, "-nolisten"); + g_ptr_array_add (arguments, "tcp"); + } ++ ++#ifdef HAVE_XSERVER_WITH_LISTEN ++ if (allow_remote_connections) { ++ g_ptr_array_add (arguments, "-listen"); ++ g_ptr_array_add (arguments, "tcp"); ++ } + #endif + + g_ptr_array_add (arguments, "-background"); + g_ptr_array_add (arguments, "none"); + + g_ptr_array_add (arguments, "-noreset"); + g_ptr_array_add (arguments, "-keeptty"); + g_ptr_array_add (arguments, "-novtswitch"); + + g_ptr_array_add (arguments, "-verbose"); + if (state->debug_enabled) { + g_ptr_array_add (arguments, "7"); + } else { + g_ptr_array_add (arguments, "3"); + } + + if (state->debug_enabled) { + g_ptr_array_add (arguments, "-core"); + } + g_ptr_array_add (arguments, NULL); + + subprocess = g_subprocess_launcher_spawnv (launcher, + (const char * const *) arguments->pdata, + &error); + g_free (display_fd_string); + g_clear_object (&launcher); + g_ptr_array_free (arguments, TRUE); + + if (subprocess == NULL) { + g_debug ("could not start X server: %s", error->message); +diff --git a/meson.build b/meson.build +index 06d09659..8328dd97 100644 +--- a/meson.build ++++ b/meson.build +@@ -44,61 +44,61 @@ glib_min_version = '2.56.0' + glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version) + gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version) + gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version) + gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version) + gtk_dep = dependency('gtk+-3.0', version: '>= 2.91.1') + libcanberra_gtk_dep = dependency('libcanberra-gtk3', version: '>= 0.4') + accountsservice_dep = dependency('accountsservice', version: '>= 0.6.35') + xcb_dep = dependency('xcb') + keyutils_dep = dependency('libkeyutils', required: false) + libselinux_dep = dependency('libselinux', required: get_option('selinux')) + + # udev + if udev_dir == '' + if udev_dep.found() + udev_prefix = udev_dep.get_pkgconfig_variable('udevdir') + else + udev_prefix = gdm_prefix / 'lib' / 'udev' + endif + udev_dir = udev_prefix / 'rules.d' + endif + + # X11 + x_deps = declare_dependency( + dependencies: [ + dependency('x11'), + dependency('xau'), + ], + ) + # Xserver 1.17 & later default to -nolisten and require -listen for remote access + xserver_deps = dependency('xorg-server', version : '>=1.17', required : false) +-xserver_nolisten_default = xserver_deps.found() ++xserver_has_listen = xserver_deps.found() + find_x_server_script = find_program('build-aux/find-x-server.sh', native: true) + find_x_server_out = run_command(find_x_server_script).stdout().strip() + if find_x_server_out != '' + x_bin = find_x_server_out + x_bin_path_split = x_bin.split('/') + i = 0 + x_path = '/' + foreach dir : x_bin_path_split + if i < x_bin_path_split.length() - 1 + x_path = x_path / dir + endif + i = i + 1 + endforeach + else + # what to do, what to do, this is wrong, but this just sets the + # defaults, perhaps this user is cross compiling or some such + x_path = '/usr/bin/X11:/usr/X11R6/bin:/opt/X11R6/bin' + x_bin = '/usr/bin/X' + endif + xdmcp_dep = cc.find_library('Xdmcp', required: get_option('xdmcp')) + if xdmcp_dep.found() and get_option('tcp-wrappers') + libwrap_dep = cc.find_library('libwrap') + endif + # systemd + systemd_dep = dependency('systemd') + libsystemd_dep = dependency('libsystemd') + if meson.version().version_compare('>= 0.53') + systemd_multiseat_x = find_program('systemd-multi-seat-x', + required: false, + dirs: [ +@@ -200,61 +200,61 @@ conf.set_quoted('SYSCONFDIR', gdm_prefix / get_option('sysconfdir')) + conf.set_quoted('BINDIR', gdm_prefix / get_option('bindir')) + conf.set_quoted('LIBDIR', gdm_prefix / get_option('libdir')) + conf.set_quoted('LIBEXECDIR', gdm_prefix / get_option('libexecdir')) + conf.set_quoted('LOGDIR', get_option('log-dir')) + conf.set_quoted('DMCONFDIR', dmconfdir) + conf.set_quoted('GDMCONFDIR', gdmconfdir) + conf.set_quoted('GDM_SCREENSHOT_DIR', gdm_screenshot_dir) + conf.set_quoted('GDM_XAUTH_DIR', gdm_xauth_dir) + conf.set_quoted('GDM_RAN_ONCE_MARKER_DIR', ran_once_marker_dir) + conf.set_quoted('GDM_RUN_DIR', gdm_run_dir) + conf.set_quoted('GNOMELOCALEDIR', gdm_prefix / get_option('localedir')) + conf.set_quoted('AT_SPI_REGISTRYD_DIR', at_spi_registryd_dir) + conf.set_quoted('GDM_PID_FILE', gdm_pid_file) + conf.set_quoted('GNOME_SETTINGS_DAEMON_DIR', gnome_settings_daemon_dir) + conf.set_quoted('LANG_CONFIG_FILE', lang_config_file) + conf.set('HAVE_ADT', have_adt) + conf.set('HAVE_UTMP_H', have_utmp_header) + conf.set('HAVE_UTMPX_H', have_utmpx_header) + conf.set('HAVE_POSIX_GETPWNAM_R', have_posix_getpwnam_r) + conf.set('UTMP', utmp_struct) + conf.set('HAVE_GETUTXENT', cc.has_function('getutxent')) + conf.set('HAVE_UPDWTMP', cc.has_function('updwtmp')) + conf.set('HAVE_UPDWTMPX', cc.has_function('updwtmpx')) + conf.set('HAVE_LOGIN', cc.has_function('login', args: '-lutil')) + conf.set('HAVE_LOGOUT', cc.has_function('logout', args: '-lutil')) + conf.set('HAVE_LOGWTMP', cc.has_function('logwtmp', args: '-lutil')) + conf.set('HAVE_PAM_SYSLOG', have_pam_syslog) + conf.set('HAVE_KEYUTILS', keyutils_dep.found()) + conf.set('SUPPORTS_PAM_EXTENSIONS', pam_extensions_supported) + conf.set('HAVE_SELINUX', libselinux_dep.found()) +-conf.set('HAVE_XSERVER_THAT_DEFAULTS_TO_LOCAL_ONLY', xserver_nolisten_default) ++conf.set('HAVE_XSERVER_WITH_LISTEN', xserver_has_listen) + conf.set('ENABLE_USER_DISPLAY_SERVER', get_option('user-display-server')) + conf.set('ENABLE_SYSTEMD_JOURNAL', get_option('systemd-journal')) + conf.set('ENABLE_WAYLAND_SUPPORT', get_option('wayland-support')) + conf.set('ENABLE_PROFILING', get_option('profiling')) + conf.set('GDM_INITIAL_VT', get_option('initial-vt')) + conf.set_quoted('GDM_DEFAULTS_CONF', gdm_defaults_conf) + conf.set_quoted('GDM_CUSTOM_CONF', gdm_custom_conf) + conf.set_quoted('GDM_RUNTIME_CONF', gdm_runtime_conf) + conf.set_quoted('GDM_SESSION_DEFAULT_PATH', get_option('default-path')) + conf.set_quoted('GDM_USERNAME', get_option('user')) + conf.set_quoted('GDM_GROUPNAME', get_option('group')) + conf.set('HAVE_LIBXDMCP', xdmcp_dep.found()) + conf.set_quoted('SYSTEMD_X_SERVER', systemd_x_server) + conf.set('WITH_PLYMOUTH', plymouth_dep.found()) + conf.set_quoted('X_SERVER', x_bin) + conf.set_quoted('X_PATH', x_path) + conf.set('HAVE_UT_UT_HOST', utmp_has_host_field) + conf.set('HAVE_UT_UT_PID', utmp_has_pid_field) + conf.set('HAVE_UT_UT_ID', utmp_has_id_field) + conf.set('HAVE_UT_UT_NAME', utmp_has_name_field) + conf.set('HAVE_UT_UT_TYPE', utmp_has_type_field) + conf.set('HAVE_UT_UT_EXIT_E_TERMINATION', utmp_has_exit_e_termination_field) + conf.set('HAVE_UT_UT_USER', utmp_has_user_field) + conf.set('HAVE_UT_UT_TIME', utmp_has_time_field) + conf.set('HAVE_UT_UT_TV', utmp_has_tv_field) + conf.set('HAVE_UT_UT_SYSLEN', utmp_has_syslen_field) + conf.set('ENABLE_IPV6', get_option('ipv6')) + configure_file(output: 'config.h', configuration: conf) + + # Subdirs +-- +2.33.1 + diff --git a/SOURCES/0002-libgdm-Sort-session-list.patch b/SOURCES/0002-libgdm-Sort-session-list.patch index abeb851..6ba1b6c 100644 --- a/SOURCES/0002-libgdm-Sort-session-list.patch +++ b/SOURCES/0002-libgdm-Sort-session-list.patch @@ -1,7 +1,7 @@ -From 6bdb7cf9e8ace0d9a42fd921d7192dcfece687fa Mon Sep 17 00:00:00 2001 +From c00daca1579c47f3f62894ff2378c37e6cbebfd3 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. @@ -11,7 +11,7 @@ This commit changes the code to sort by description. 1 file changed, 19 insertions(+) diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c -index 97ed5ef3d..f078e04b8 100644 +index 97ed5ef3..f078e04b 100644 --- a/libgdm/gdm-sessions.c +++ b/libgdm/gdm-sessions.c @@ -311,92 +311,111 @@ collect_sessions (void) @@ -127,5 +127,5 @@ index 97ed5ef3d..f078e04b8 100644 if (session == NULL) { return NULL; -- -2.31.1 +2.34.1 diff --git a/SOURCES/0002-session-support-new-accountsservice-Session-and-Sess.patch b/SOURCES/0002-session-support-new-accountsservice-Session-and-Sess.patch index a4d8909..6cb961e 100644 --- a/SOURCES/0002-session-support-new-accountsservice-Session-and-Sess.patch +++ b/SOURCES/0002-session-support-new-accountsservice-Session-and-Sess.patch @@ -1,4 +1,4 @@ -From c4716129cc3042ca9fa2ab7ee420800d85ec09db Mon Sep 17 00:00:00 2001 +From 22b08727980cefd665b8805376710e9244523fe3 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 14 Aug 2018 14:52:41 -0400 Subject: [PATCH 2/4] session: support new accountsservice Session and @@ -20,7 +20,7 @@ This commit switches GDM over to use the new properties. 5 files changed, 153 insertions(+), 29 deletions(-) diff --git a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c -index 484a3b5b4..5b64cb65b 100644 +index 484a3b5b..f2b1addd 100644 --- a/daemon/gdm-session-settings.c +++ b/daemon/gdm-session-settings.c @@ -12,114 +12,121 @@ @@ -305,14 +305,14 @@ index 484a3b5b4..5b64cb65b 100644 - session_name = act_user_get_x_session (settings->priv->user); - g_debug ("GdmSessionSettings: saved session is %s", session_name); -+ + +- if (session_name != NULL) { + + + + session_type = act_user_get_session_type (settings->priv->user); + session_name = act_user_get_session (settings->priv->user); - -- if (session_name != NULL) { ++ + g_debug ("GdmSessionSettings: saved session is %s (type %s)", session_name, session_type); + + if (session_type != NULL && session_type[0] != '\0') { @@ -409,7 +409,7 @@ index 484a3b5b4..5b64cb65b 100644 return TRUE; } diff --git a/daemon/gdm-session-settings.h b/daemon/gdm-session-settings.h -index 20946bff1..db38ffc72 100644 +index 20946bff..db38ffc7 100644 --- a/daemon/gdm-session-settings.h +++ b/daemon/gdm-session-settings.h @@ -33,37 +33,40 @@ G_BEGIN_DECLS @@ -454,10 +454,10 @@ index 20946bff1..db38ffc72 100644 G_END_DECLS #endif /* GDM_SESSION_SETTINGS_H */ diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c -index 88fe36c16..c1201b704 100644 +index 438348df..9cff53a5 100644 --- a/daemon/gdm-session-worker.c +++ b/daemon/gdm-session-worker.c -@@ -2664,60 +2664,74 @@ gdm_session_worker_handle_set_language_name (GdmDBusWorker *object, +@@ -2662,60 +2662,74 @@ gdm_session_worker_handle_set_language_name (GdmDBusWorker *object, gdm_dbus_worker_complete_set_language_name (object, invocation); return TRUE; } @@ -532,7 +532,7 @@ index 88fe36c16..c1201b704 100644 static void do_authenticate (GdmSessionWorker *worker) { -@@ -3127,158 +3141,172 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object, +@@ -3125,158 +3139,172 @@ gdm_session_worker_handle_initialize (GdmDBusWorker *object, } else if (g_strcmp0 (key, "x11-authority-file") == 0) { worker->priv->x11_authority_file = g_variant_dup_string (value, NULL); } else if (g_strcmp0 (key, "console") == 0) { @@ -706,7 +706,7 @@ index 88fe36c16..c1201b704 100644 const char *log_file) { diff --git a/daemon/gdm-session-worker.xml b/daemon/gdm-session-worker.xml -index 4280fe095..a215779c8 100644 +index 4280fe09..a215779c 100644 --- a/daemon/gdm-session-worker.xml +++ b/daemon/gdm-session-worker.xml @@ -51,40 +51,43 @@ @@ -754,7 +754,7 @@ index 4280fe095..a215779c8 100644 diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c -index 6e6326243..73ae5cbc5 100644 +index 72afe7b2..f4d0bef9 100644 --- a/daemon/gdm-session.c +++ b/daemon/gdm-session.c @@ -61,60 +61,61 @@ @@ -1222,7 +1222,7 @@ index 6e6326243..73ae5cbc5 100644 static void set_pending_query (GdmSessionConversation *conversation, -@@ -969,80 +989,91 @@ worker_on_reauthenticated (GdmDBusWorker *worker, +@@ -969,85 +989,96 @@ worker_on_reauthenticated (GdmDBusWorker *worker, GdmSession *self = conversation->session; g_debug ("GdmSession: Emitting 'reauthenticated' signal "); g_signal_emit (self, signals[REAUTHENTICATED], 0, service_name); @@ -1259,19 +1259,24 @@ index 6e6326243..73ae5cbc5 100644 g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name); g_free (self->saved_session); self->saved_session = NULL; - } else if (strcmp (session_name, - get_default_session_name (self)) != 0) { - g_free (self->saved_session); - self->saved_session = g_strdup (session_name); - - if (self->greeter_interface != NULL) { - gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface, - session_name); + update_session_type (self); + } else { + if (strcmp (session_name, + get_default_session_name (self)) != 0) { + g_free (self->saved_session); + self->saved_session = g_strdup (session_name); + + if (self->greeter_interface != NULL) { + gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface, + session_name); + } } + if (self->saved_session_type != NULL) + set_session_type (self, self->saved_session_type); + else + update_session_type (self); } - update_session_type (self); - } +static void @@ -1315,7 +1320,7 @@ index 6e6326243..73ae5cbc5 100644 uid_t connecting_user; connecting_user = g_credentials_get_unix_user (credentials, NULL); -@@ -1122,60 +1153,63 @@ register_worker (GdmDBusWorkerManager *worker_manager_interface, +@@ -1127,60 +1158,63 @@ register_worker (GdmDBusWorkerManager *worker_manager_interface, g_dbus_method_invocation_return_value (invocation, NULL); conversation->worker_proxy = gdm_dbus_worker_proxy_new_sync (connection, @@ -1379,7 +1384,7 @@ index 6e6326243..73ae5cbc5 100644 g_debug ("GdmSession: Conversation started"); return TRUE; -@@ -1918,60 +1952,63 @@ free_conversation (GdmSessionConversation *conversation) +@@ -1923,60 +1957,63 @@ free_conversation (GdmSessionConversation *conversation) close_conversation (conversation); if (conversation->job != NULL) { @@ -1443,7 +1448,7 @@ index 6e6326243..73ae5cbc5 100644 error = NULL; if (!g_file_get_contents (config_file, &contents, &length, &error)) { g_debug ("Failed to parse '%s': %s", -@@ -2530,83 +2567,83 @@ gdm_session_send_environment (GdmSession *self, +@@ -2535,83 +2572,83 @@ gdm_session_send_environment (GdmSession *self, g_return_if_fail (GDM_IS_SESSION (self)); conversation = find_conversation_by_name (self, service_name); @@ -1529,7 +1534,7 @@ index 6e6326243..73ae5cbc5 100644 g_strdup (value)); } -@@ -3176,148 +3213,150 @@ gdm_session_get_conversation_session_id (GdmSession *self, +@@ -3181,148 +3218,150 @@ gdm_session_get_conversation_session_id (GdmSession *self, conversation = find_conversation_by_name (self, service_name); if (conversation == NULL) { @@ -1689,5 +1694,5 @@ index 6e6326243..73ae5cbc5 100644 self->display_seat_id); -- -2.31.1 +2.33.1 diff --git a/SOURCES/0003-daemon-save-os-release-in-accountsservice.patch b/SOURCES/0003-daemon-save-os-release-in-accountsservice.patch index 05682b9..e6dcb56 100644 --- a/SOURCES/0003-daemon-save-os-release-in-accountsservice.patch +++ b/SOURCES/0003-daemon-save-os-release-in-accountsservice.patch @@ -1,4 +1,4 @@ -From 09e4f57ea2525e48bd22a34cb0c9b917ce7565df Mon Sep 17 00:00:00 2001 +From de95917e0e9d142703a86f94961ef9fd4151739d Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 20 Aug 2018 14:30:59 -0400 Subject: [PATCH 3/4] daemon: save os-release in accountsservice @@ -17,7 +17,7 @@ This commit saves that information in accountsservice. diff --git a/daemon/com.redhat.AccountsServiceUser.System.xml b/daemon/com.redhat.AccountsServiceUser.System.xml new file mode 100644 -index 000000000..67f5f302c +index 00000000..67f5f302 --- /dev/null +++ b/daemon/com.redhat.AccountsServiceUser.System.xml @@ -0,0 +1,10 @@ @@ -32,7 +32,7 @@ index 000000000..67f5f302c + + diff --git a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c -index 5b64cb65b..5bcfdc14f 100644 +index f2b1addd..a4b7f1a6 100644 --- a/daemon/gdm-session-settings.c +++ b/daemon/gdm-session-settings.c @@ -1,70 +1,77 @@ @@ -233,9 +233,9 @@ index 5b64cb65b..5bcfdc14f 100644 + } + } + - - - + + + session_type = act_user_get_session_type (settings->priv->user); session_name = act_user_get_session (settings->priv->user); @@ -401,7 +401,7 @@ index 5b64cb65b..5bcfdc14f 100644 return TRUE; } diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c -index 73ae5cbc5..ce6df14c6 100644 +index f4d0bef9..d1e2c301 100644 --- a/daemon/gdm-session.c +++ b/daemon/gdm-session.c @@ -351,72 +351,72 @@ supports_session_type (GdmSession *self, @@ -480,7 +480,7 @@ index 73ae5cbc5..ce6df14c6 100644 } diff --git a/daemon/meson.build b/daemon/meson.build -index 2e61b6447..71c650398 100644 +index 2e61b644..71c65039 100644 --- a/daemon/meson.build +++ b/daemon/meson.build @@ -15,114 +15,122 @@ local_display_dbus_gen = gnome.gdbus_codegen('gdm-local-display-glue', @@ -607,5 +607,5 @@ index 2e61b6447..71c650398 100644 gdm_session_worker = executable('gdm-session-worker', -- -2.31.1 +2.33.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 new file mode 100644 index 0000000..f119615 --- /dev/null +++ b/SOURCES/0003-xdmcp-display-factory-Set-supported-session-types-fo.patch @@ -0,0 +1,122 @@ +From b5472a30b1a71aec537ac309e2985cbac61b3136 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Tue, 14 Sep 2021 11:00:33 -0400 +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 +display to be specified up front. + +This commit makes sure XDMCP displays do that. +--- + daemon/gdm-xdmcp-display-factory.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c +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, + break; + case GDM_DISPLAY_MANAGED: + if (session != NULL) { + g_signal_connect_object (G_OBJECT (session), + "client-disconnected", + G_CALLBACK (on_client_disconnected), + display, G_CONNECT_SWAPPED); + g_signal_connect_object (G_OBJECT (session), + "disconnected", + G_CALLBACK (on_client_disconnected), + display, G_CONNECT_SWAPPED); + } + break; + default: + g_assert_not_reached (); + break; + } + + g_clear_object (&launch_environment); + } + + static GdmDisplay * + gdm_xdmcp_display_create (GdmXdmcpDisplayFactory *factory, + const char *hostname, + GdmAddress *address, + int displaynum) + { + GdmDisplay *display; + GdmDisplayStore *store; + gboolean use_chooser; ++ const char *session_types[] = { "x11", NULL }; + + g_debug ("GdmXdmcpDisplayFactory: Creating xdmcp display for %s:%d", + hostname ? hostname : "(null)", displaynum); + + use_chooser = FALSE; + if (factory->honor_indirect) { + IndirectClient *ic; + + ic = indirect_client_lookup (factory, address); + + /* This was an indirect thingie and nothing was yet chosen, + * use a chooser */ + if (ic != NULL && ic->chosen_address == NULL) { + use_chooser = TRUE; + } + } + + if (use_chooser) { + display = gdm_xdmcp_chooser_display_new (hostname, + displaynum, + address, + get_next_session_serial (factory)); + g_signal_connect (display, "hostname-selected", G_CALLBACK (on_hostname_selected), factory); + } else { + display = gdm_xdmcp_display_new (hostname, + displaynum, + address, + get_next_session_serial (factory)); + } + + if (display == NULL) { + goto out; + } + ++ g_object_set (G_OBJECT (display), ++ "session-type", session_types[0], ++ "supported-session-types", session_types, ++ NULL); ++ + if (! gdm_display_prepare (display)) { + gdm_display_unmanage (display); + g_object_unref (display); + display = NULL; + goto out; + } + + g_signal_connect_after (display, + "notify::status", + G_CALLBACK (on_display_status_changed), + factory); + + store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory)); + gdm_display_store_add (store, display); + + factory->num_pending_sessions++; + out: + + return display; + } + + static void + gdm_xdmcp_send_accept (GdmXdmcpDisplayFactory *factory, + GdmAddress *address, + CARD32 session_id, + ARRAY8Ptr authentication_name, + ARRAY8Ptr authentication_data, + ARRAY8Ptr authorization_name, + ARRAY8Ptr authorization_data) + { +-- +2.34.1 + diff --git a/SOURCES/0004-daemon-handle-upgrades-from-RHEL-7.patch b/SOURCES/0004-daemon-handle-upgrades-from-RHEL-7.patch index bb72e64..8b6fe88 100644 --- a/SOURCES/0004-daemon-handle-upgrades-from-RHEL-7.patch +++ b/SOURCES/0004-daemon-handle-upgrades-from-RHEL-7.patch @@ -1,4 +1,4 @@ -From de103948b84188cd2273c9aab904a633323a9479 Mon Sep 17 00:00:00 2001 +From 738a10ca78e154ad4c3df9a1298eaad01516457e Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 20 Aug 2018 14:30:59 -0400 Subject: [PATCH 4/4] daemon: handle upgrades from RHEL 7 @@ -16,7 +16,7 @@ try to get the right settings. 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/daemon/gdm-session-settings.c b/daemon/gdm-session-settings.c -index 5bcfdc14f..a7eaa8b2f 100644 +index a4b7f1a6..a84b2ffa 100644 --- a/daemon/gdm-session-settings.c +++ b/daemon/gdm-session-settings.c @@ -270,95 +270,114 @@ gdm_session_settings_get_property (GObject *object, @@ -80,9 +80,9 @@ index 5bcfdc14f..a7eaa8b2f 100644 } } - - - + + + session_type = act_user_get_session_type (settings->priv->user); session_name = act_user_get_session (settings->priv->user); @@ -135,10 +135,10 @@ index 5bcfdc14f..a7eaa8b2f 100644 settings); } diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c -index ce6df14c6..6bda6d6e2 100644 +index d1e2c301..d4a46d87 100644 --- a/daemon/gdm-session.c +++ b/daemon/gdm-session.c -@@ -3202,98 +3202,95 @@ gdm_session_get_session_id (GdmSession *self) +@@ -3207,98 +3207,95 @@ gdm_session_get_session_id (GdmSession *self) return conversation->session_id; } @@ -246,5 +246,5 @@ index ce6df14c6..6bda6d6e2 100644 if (!session_registers && error != NULL && -- -2.31.1 +2.33.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..d17dece --- /dev/null +++ b/SOURCES/0004-local-display-factory-Don-t-crash-if-Xorg-and-Waylan.patch @@ -0,0 +1,96 @@ +From dfca67899ea33da08d3aa9e84c1b4487991adad0 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/SOURCES/default.pa-for-gdm b/SOURCES/default.pa-for-gdm index d633aee..145bd31 100644 --- a/SOURCES/default.pa-for-gdm +++ b/SOURCES/default.pa-for-gdm @@ -3,7 +3,6 @@ load-module module-card-restore load-module module-udev-detect load-module module-native-protocol-unix load-module module-default-device-restore -load-module module-rescue-streams load-module module-always-sink load-module module-intended-roles load-module module-suspend-on-idle diff --git a/SPECS/gdm.spec b/SPECS/gdm.spec index b97a14a..d6fd59d 100644 --- a/SPECS/gdm.spec +++ b/SPECS/gdm.spec @@ -12,7 +12,7 @@ Name: gdm Epoch: 1 Version: 40.0 -Release: 12%{?dist} +Release: 23%{?dist} Summary: The GNOME Display Manager License: GPLv2+ @@ -23,6 +23,8 @@ Source1: org.gnome.login-screen.gschema.override # Lets customers using vendor nvidia driver pick wayland sessions from the login screen 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 @@ -38,8 +40,20 @@ Patch60003: 0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch # Upstream change that's moderately risky so revert it Patch70001: 0001-Revert-gdm-wayland-x-session-don-t-overwrite-user-en.patch +# Crash fix +Patch80001: 0001-local-display-factory-Don-t-try-to-respawn-displays-.patch + +# VT handling fix from upstream +Patch90001: 0001-session-worker-Set-session_vt-0-out-of-pam-uninitial.patch + +# Wayland fix from upstream +Patch100001: 0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch + +# Fix DisallowTcp=false from upstream +Patch110001: 0001-meson-Fix-detection-of-Xorg-versions-that-need-liste.patch +Patch110002: 0002-daemon-Support-X-servers-built-with-Dlisten_tcp-true.patch + # Non-upstreamable workarounds -Patch66610001: 0001-local-display-factory-pause-for-a-few-seconds-before.patch Patch66620001: 0001-data-reap-gdm-sessions-on-shutdown.patch # Non-upstreamable integration patches @@ -56,6 +70,7 @@ Patch99930001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch Patch99940001: 0001-data-disable-wayland-on-certain-hardware.patch + BuildRequires: accountsservice-devel BuildRequires: audit-libs-devel >= %{libauditver} BuildRequires: dconf @@ -113,7 +128,7 @@ Requires: libXau >= 1.0.4-4 Requires: pam >= 0:%{pam_version} Requires: /sbin/nologin Requires: setxkbmap -Requires: systemd >= 186 +Requires: systemd >= 239-50 Requires: system-logos Requires: xorg-x11-server-utils Requires: xorg-x11-xinit @@ -334,7 +349,7 @@ fi %{_libdir}/girepository-1.0/Gdm-1.0.typelib %{_libdir}/security/pam_gdm.so %{_libdir}/libgdm*.so* -%dir %{_localstatedir}/log/gdm +%attr(0711, root, gdm) %dir %{_localstatedir}/log/gdm %attr(1770, gdm, gdm) %dir %{_localstatedir}/lib/gdm %attr(0700, gdm, gdm) %dir %{_localstatedir}/lib/gdm/.config %attr(0700, gdm, gdm) %dir %{_localstatedir}/lib/gdm/.config/pulse @@ -360,6 +375,46 @@ fi %{_libdir}/pkgconfig/gdm-pam-extensions.pc %changelog +* Thu Jan 27 2022 Ray Strode - 40.0-23 +- Fix crash when neither Xorg nor wayland is working great + Resolves: #2032180 + +* Wed Dec 22 2021 Ray Strode - 40.1-22 +- Fix DisallowTCP + Resolves: #2025768 + +* Tue Dec 21 2021 Ray Strode - 40.1-21 +- Fix Xorg/Wayland selection in some cases + Resolves: #2009045 + +* Mon Oct 25 2021 Ray Strode - 40.1-20 +- Remove module-rescue-stream from default.pa + Resolves: #1969846 + +* Mon Oct 25 2021 Ray Strode - 40.0-19 +- Synchronize permission and group ownership for log dir between + rpm file manifest and daemon expectations. + Resolves: #1878119 + +* Mon Oct 25 2021 Ray Strode - 40.0-18 +- Drop usleep workaround for problem that's now fixed properly in systemd + Resolves: #1921732 + +* Wed Oct 13 2021 Ray Strode - 40.0-17 +- Properly switch VTs when jumping to multi-user target + Related: #1988958 + +* Wed Sep 15 2021 Ray Strode - 40.0-16 +- Fix XDMCP + Resolves: #2005011 +- Fix crash at shutdown + Related: #2005011 + +* Wed Sep 01 2021 Ray Strode - 40.0-14 +- Disable Wayland on HyperV +- Fix Xorg fallback + Related: #2000904 + * Thu Aug 19 2021 Ray Strode - 40.0-12 - Redisable on server chips since rebase Related: #1909300