From 3244c77b25a57d36be0889aa60d26222f23fc4d9 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 28 Mar 2023 10:07:14 +0000 Subject: [PATCH] import gdm-40.1-21.el9 --- ...1-manager-Fix-btmp-record-accounting.patch | 227 ++++++++++++++++++ ...ltiple-xdmcp-logins-for-the-same-use.patch | 10 +- ...n-run-session-bus-on-non-seat0-seats.patch | 4 +- ...ogin-screen-over-XDMCP-connects-to-i.patch | 4 +- SOURCES/gdm-tmpfiles.conf | 7 + SPECS/gdm.spec | 36 ++- 6 files changed, 274 insertions(+), 14 deletions(-) create mode 100644 SOURCES/0001-manager-Fix-btmp-record-accounting.patch create mode 100644 SOURCES/gdm-tmpfiles.conf diff --git a/SOURCES/0001-manager-Fix-btmp-record-accounting.patch b/SOURCES/0001-manager-Fix-btmp-record-accounting.patch new file mode 100644 index 0000000..411c374 --- /dev/null +++ b/SOURCES/0001-manager-Fix-btmp-record-accounting.patch @@ -0,0 +1,227 @@ +From d9dd381a574a02b239438db4fcc9d6ac2fd82ee0 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Wed, 19 Oct 2022 14:50:33 -0400 +Subject: [PATCH] manager: Fix btmp record accounting + +Before a user logs in they don't have a display. + +btmp records currently need a display though, and they +get written when the user can't log in. + +Furthermore, the display from X11 point of view is +somewhat archaic. We use wayland by default now. + +In lieu of a display, this commit gives the btmp record +the seat id instead. +--- + daemon/gdm-manager.c | 11 +++++++++-- + daemon/gdm-session-record.c | 8 ++++++-- + 2 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c +index cc61efc9..e1bc62d7 100644 +--- a/daemon/gdm-manager.c ++++ b/daemon/gdm-manager.c +@@ -628,113 +628,120 @@ switch_to_compatible_user_session (GdmManager *manager, + + ret = TRUE; + + out: + return ret; + } + + static GdmDisplay * + get_display_for_user_session (GdmSession *session) + { + return g_object_get_data (G_OBJECT (session), "gdm-display"); + } + + static GdmSession * + get_user_session_for_display (GdmDisplay *display) + { + if (display == NULL) { + return NULL; + } + + return g_object_get_data (G_OBJECT (display), "gdm-user-session"); + } + + static gboolean + add_session_record (GdmManager *manager, + GdmSession *session, + GPid pid, + SessionRecord record) + { + const char *username; +- char *display_name, *hostname, *display_device; ++ char *display_name, *hostname, *display_device, *display_seat_id; + gboolean recorded = FALSE; + + display_name = NULL; + username = NULL; + hostname = NULL; + display_device = NULL; ++ display_seat_id = NULL; + + username = gdm_session_get_username (session); + + if (username == NULL) { + goto out; + } + + g_object_get (G_OBJECT (session), + "display-name", &display_name, + "display-hostname", &hostname, + "display-device", &display_device, ++ "display-seat-id", &display_seat_id, + NULL); + + if (display_name == NULL && display_device == NULL) { +- goto out; ++ if (display_seat_id == NULL) ++ goto out; ++ ++ display_name = g_strdup ("login screen"); ++ display_device = g_strdup (display_seat_id); + } + + switch (record) { + case SESSION_RECORD_LOGIN: + gdm_session_record_login (pid, + username, + hostname, + display_name, + display_device); + break; + case SESSION_RECORD_LOGOUT: + gdm_session_record_logout (pid, + username, + hostname, + display_name, + display_device); + break; + case SESSION_RECORD_FAILED: + gdm_session_record_failed (pid, + username, + hostname, + display_name, + display_device); + break; + } + + recorded = TRUE; + out: + g_free (display_name); + g_free (hostname); + g_free (display_device); ++ g_free (display_seat_id); + + return recorded; + } + + static GdmSession * + find_user_session_for_display (GdmManager *self, + GdmDisplay *display) + { + + GList *node = self->priv->user_sessions; + + while (node != NULL) { + GdmSession *session = node->data; + GdmDisplay *candidate_display; + GList *next_node = node->next; + + candidate_display = get_display_for_user_session (session); + + if (candidate_display == display) + return session; + + node = next_node; + } + + return NULL; + } + + static gboolean + gdm_manager_handle_register_display (GdmDBusManager *manager, + GDBusMethodInvocation *invocation, +diff --git a/daemon/gdm-session-record.c b/daemon/gdm-session-record.c +index 7719d0a8..310323b6 100644 +--- a/daemon/gdm-session-record.c ++++ b/daemon/gdm-session-record.c +@@ -125,66 +125,70 @@ record_set_host (UTMP *u, + */ + if (host_name != NULL + && x11_display_name != NULL + && g_str_has_prefix (x11_display_name, ":")) { + hostname = g_strdup_printf ("%s%s", host_name, x11_display_name); + } else { + hostname = g_strdup (x11_display_name); + } + + if (hostname != NULL) { + memccpy (u->ut_host, hostname, '\0', sizeof (u->ut_host)); + g_debug ("using ut_host %.*s", (int) sizeof (u->ut_host), u->ut_host); + #ifdef HAVE_UT_UT_SYSLEN + u->ut_syslen = MIN (strlen (hostname), sizeof (u->ut_host)); + #endif + g_free (hostname); + } + #endif + } + + static void + record_set_line (UTMP *u, + const char *display_device, + const char *x11_display_name) + { + /* + * Set ut_line to the device name associated with this display + * but remove the "/dev/" prefix. If no device, then use the + * $DISPLAY value. + */ +- if (display_device != NULL +- && g_str_has_prefix (display_device, "/dev/")) { ++ if (display_device != NULL && g_str_has_prefix (display_device, "/dev/")) { + memccpy (u->ut_line, + display_device + strlen ("/dev/"), + '\0', + sizeof (u->ut_line)); ++ } else if (display_device != NULL && g_str_has_prefix (display_device, "seat")) { ++ memccpy (u->ut_line, ++ display_device, ++ '\0', ++ sizeof (u->ut_line)); + } else if (x11_display_name != NULL) { + memccpy (u->ut_line, + x11_display_name, + '\0', + sizeof (u->ut_line)); + } + + g_debug ("using ut_line %.*s", (int) sizeof (u->ut_line), u->ut_line); + } + + void + gdm_session_record_login (GPid session_pid, + const char *user_name, + const char *host_name, + const char *x11_display_name, + const char *display_device) + { + UTMP session_record = { 0 }; + + if (x11_display_name == NULL) + x11_display_name = display_device; + + record_set_username (&session_record, user_name); + + g_debug ("Writing login record"); + + #if defined(HAVE_UT_UT_TYPE) + session_record.ut_type = USER_PROCESS; + g_debug ("using ut_type USER_PROCESS"); + #endif +-- +2.37.3 + diff --git a/SOURCES/0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch b/SOURCES/0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch index 13b39da..f514073 100644 --- a/SOURCES/0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch +++ b/SOURCES/0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch @@ -1,4 +1,4 @@ -From 2e7965beae81e0e93d3f475f2ea29a7af6c23f29 Mon Sep 17 00:00:00 2001 +From 58f2bb3560f1066d0cda93a749a6d1648e3c3d0c Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Thu, 20 Dec 2018 14:51:38 -0500 Subject: [PATCH 1/3] manager: allow multiple xdmcp logins for the same user @@ -53,7 +53,7 @@ index 87685d3c..4b3a1ffe 100644 #endif /* _GDM_SETTINGS_KEYS_H */ diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c -index cc61efc9..dc839aeb 100644 +index e1bc62d7..08c3cc17 100644 --- a/daemon/gdm-manager.c +++ b/daemon/gdm-manager.c @@ -566,93 +566,106 @@ get_display_and_details_for_bus_sender (GdmManager *self, @@ -180,8 +180,8 @@ index cc61efc9..dc839aeb 100644 SessionRecord record) { const char *username; - char *display_name, *hostname, *display_device; -@@ -1089,92 +1102,114 @@ open_temporary_reauthentication_channel (GdmManager *self, + char *display_name, *hostname, *display_device, *display_seat_id; +@@ -1096,92 +1109,114 @@ open_temporary_reauthentication_channel (GdmManager *self, g_signal_connect (session, "client-disconnected", G_CALLBACK (on_reauthentication_client_disconnected), @@ -340,5 +340,5 @@ index a1035f95..929d13d9 100644 -- -2.32.0 +2.37.3 diff --git a/SOURCES/0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch b/SOURCES/0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch index c195db5..000b95c 100644 --- a/SOURCES/0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch +++ b/SOURCES/0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch @@ -1,4 +1,4 @@ -From 618dfea6563d4f0bad0583b38b63746e44969d5e Mon Sep 17 00:00:00 2001 +From ea1de1173b46f76fe00b4f52b2b71ad16e35acc3 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 5 Feb 2020 15:20:48 -0500 Subject: [PATCH 2/3] gdm-x-session: run session bus on non-seat0 seats @@ -147,5 +147,5 @@ index a65fa0f9..f13b54af 100644 self->selected_program); } -- -2.32.0 +2.37.3 diff --git a/SOURCES/0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch b/SOURCES/0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch index 15bc1ce..21efc57 100644 --- a/SOURCES/0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch +++ b/SOURCES/0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch @@ -1,4 +1,4 @@ -From f30e557a8afcdfe5d571a625b4c99606315ed3b4 Mon Sep 17 00:00:00 2001 +From 73ccd50cabda8102b724d9bf647ac5a74963040d Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 11 Feb 2019 10:32:55 -0500 Subject: [PATCH 3/3] session: ensure login screen over XDMCP connects to its @@ -101,5 +101,5 @@ index f13b54af..9f68166e 100644 gpointer key, value; -- -2.32.0 +2.37.3 diff --git a/SOURCES/gdm-tmpfiles.conf b/SOURCES/gdm-tmpfiles.conf new file mode 100644 index 0000000..9dac49d --- /dev/null +++ b/SOURCES/gdm-tmpfiles.conf @@ -0,0 +1,7 @@ +# These directories should be automatically created by systemd-tmpfiles(8) during boot +d /run/gdm 0711 root gdm - - +d /var/lib/gdm 1770 gdm gdm - - +d /var/lib/gdm/.config 0700 gdm gdm - - +d /var/lib/gdm/.config/pulse 0700 gdm gdm - - +d /var/log/gdm 0755 root root - - + diff --git a/SPECS/gdm.spec b/SPECS/gdm.spec index 43bc679..da5149f 100644 --- a/SPECS/gdm.spec +++ b/SPECS/gdm.spec @@ -11,13 +11,14 @@ Name: gdm Epoch: 1 Version: 40.1 -Release: 16%{?dist} +Release: 21%{?dist} Summary: The GNOME Display Manager License: GPLv2+ URL: https://wiki.gnome.org/Projects/GDM Source0: http://download.gnome.org/sources/gdm/40/gdm-%{tarball_version}.tar.xz Source1: org.gnome.login-screen.gschema.override +Source2: gdm-tmpfiles.conf # moved here from pulseaudio-gdm-hooks-11.1-16 Source5: default.pa-for-gdm @@ -40,11 +41,13 @@ Patch50002: 0002-daemon-Support-X-servers-built-with-Dlisten_tcp-true.patch Patch60001: 0001-session-settings-Fetch-session-from-user-even-if-use.patch +Patch70001: 0001-manager-Fix-btmp-record-accounting.patch + # Latest udev rules and support code -Patch70001: 0001-local-display-factory-Stall-startup-until-main-graph.patch -Patch70002: 0002-common-Add-API-to-reload-settings-from-disk.patch -Patch70003: 0003-common-Reload-settings-when-graphics-initialize.patch -Patch70004: 0004-data-Use-latest-upstream-udev-rules.patch +Patch90001: 0001-local-display-factory-Stall-startup-until-main-graph.patch +Patch90002: 0002-common-Add-API-to-reload-settings-from-disk.patch +Patch90003: 0003-common-Reload-settings-when-graphics-initialize.patch +Patch90004: 0004-data-Use-latest-upstream-udev-rules.patch # Non-upstreamable workarounds Patch66610001: 0001-data-reap-gdm-sessions-on-shutdown.patch @@ -167,6 +170,7 @@ GDM specific authentication features. -Drun-dir=/run/gdm \ -Dudev-dir=%{_udevrulesdir} \ -Ddefault-path=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin \ + -Dipv6=true \ -Dprofiling=true \ -Dplymouth=enabled \ -Dselinux=enabled @@ -180,6 +184,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/gdm/PostSession %meson_install +install -p -m644 -D %{SOURCE2} %{buildroot}%{_tmpfilesdir}/%{name}.conf install -p -m644 -D %{SOURCE5} %{buildroot}%{_localstatedir}/lib/gdm/.config/pulse/default.pa rm -f %{buildroot}%{_sysconfdir}/pam.d/gdm @@ -331,6 +336,7 @@ dconf update || : %{_unitdir}/gdm.service %dir %{_userunitdir}/gnome-session@gnome-login.target.d/ %{_userunitdir}/gnome-session@gnome-login.target.d/session.conf +%{_tmpfilesdir}/%{name}.conf %files devel %dir %{_includedir}/gdm @@ -345,6 +351,26 @@ dconf update || : %{_libdir}/pkgconfig/gdm-pam-extensions.pc %changelog +* Fri Jan 27 2023 Ray Strode - 40.1-21 +- Enable IPV6 support + Resolves: #2165049 + +* Wed Jan 18 2023 Ray Strode - 40.1-20 +- Ensure /run/gdm and other gdm directories are created at boot up + Resolves: #2047942 + +* Wed Jan 11 2023 Ray Strode - 40.1-19 +- Re-enable Wayland on aspeed + Resolves: #2131203 + +* Wed Nov 02 2022 Ray Strode - 40.1-18 +- Fix btmp accounting + Resolves: #2073275 + +* Thu Sep 29 2022 Ray Strode - 40.1-17 +- Disable Wayland on aspeed + Related: #2097308 + * Tue Apr 12 2022 Ray Strode - 40.1-16 - Reenable Wayland for matrox and aspeed Resolves: #2097308