Browse Source

update to release 21

Signed-off-by: Toshaan Bharvani <toshaan@powerel.org>
master
Toshaan Bharvani 4 months ago
parent
commit
6677f00427
  1. 227
      SOURCES/0001-manager-Fix-btmp-record-accounting.patch
  2. 10
      SOURCES/0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch
  3. 4
      SOURCES/0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch
  4. 4
      SOURCES/0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch
  5. 2
      SOURCES/0004-daemon-Consolidate-session-type-and-supported-sessio.patch
  6. 18
      SOURCES/0004-data-Use-latest-upstream-udev-rules.patch
  7. 7
      SOURCES/gdm-tmpfiles.conf
  8. 59
      SPECS/gdm.spec

227
SOURCES/0001-manager-Fix-btmp-record-accounting.patch

@ -0,0 +1,227 @@ @@ -0,0 +1,227 @@
From d9dd381a574a02b239438db4fcc9d6ac2fd82ee0 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
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

10
SOURCES/0001-manager-allow-multiple-xdmcp-logins-for-the-same-use.patch

@ -1,4 +1,4 @@ @@ -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 <rstrode@redhat.com>
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 @@ -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 @@ -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 @@ -340,5 +340,5 @@ index a1035f95..929d13d9 100644
</gdmschemafile>
--
2.32.0
2.37.3


4
SOURCES/0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch

@ -1,4 +1,4 @@ @@ -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 <rstrode@redhat.com>
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 @@ -147,5 +147,5 @@ index a65fa0f9..f13b54af 100644
self->selected_program);
}
--
2.32.0
2.37.3


4
SOURCES/0003-session-ensure-login-screen-over-XDMCP-connects-to-i.patch

@ -1,4 +1,4 @@ @@ -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 <rstrode@redhat.com>
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 @@ -101,5 +101,5 @@ index f13b54af..9f68166e 100644
gpointer key, value;
--
2.32.0
2.37.3


2
SOURCES/0004-daemon-Consolidate-session-type-and-supported-sessio.patch

@ -260,7 +260,7 @@ index 141d64c6..eba38671 100644 @@ -260,7 +260,7 @@ index 141d64c6..eba38671 100644
- 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,
+ "supported-session-types", session_types,
+ NULL);
is_initial = TRUE;
}

18
SOURCES/0004-data-Use-latest-upstream-udev-rules.patch

@ -16,7 +16,7 @@ diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in @@ -16,7 +16,7 @@ diff --git a/data/61-gdm.rules.in b/data/61-gdm.rules.in
index b1da191f..5dae00ea 100644
--- a/data/61-gdm.rules.in
+++ b/data/61-gdm.rules.in
@@ -1,6 +1,137 @@
@@ -1,6 +1,123 @@
+# identify virtio graphics cards to find passthrough setups
+SUBSYSTEM!="virtio", GOTO="gdm_virtio_device_end"
+ACTION!="add", GOTO="gdm_virtio_device_end"
@ -24,7 +24,7 @@ index b1da191f..5dae00ea 100644 @@ -24,7 +24,7 @@ index b1da191f..5dae00ea 100644
+LABEL="gdm_virtio_device_end"
+
+SUBSYSTEM!="pci", GOTO="gdm_pci_device_end"
+ACTION!="bind", GOTO="gdm_pci_device_end"
+ACTION!="bind", ACTION!="add", GOTO="gdm_pci_device_end"
+
+# identify virtio graphics cards to find passthrough setups
+# cirrus
@ -40,20 +40,6 @@ index b1da191f..5dae00ea 100644 @@ -40,20 +40,6 @@ index b1da191f..5dae00ea 100644
-DRIVER=="nvidia", RUN+="@libexecdir@/gdm-runtime-config set daemon WaylandEnable false"
+ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", GOTO="gdm_disable_wayland"
+
+# disable Wayland on Matrox chipsets
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0522", GOTO="gdm_disable_wayland"
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0524", GOTO="gdm_disable_wayland"
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0530", GOTO="gdm_disable_wayland"
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0532", GOTO="gdm_disable_wayland"
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0533", GOTO="gdm_disable_wayland"
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0534", GOTO="gdm_disable_wayland"
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0536", GOTO="gdm_disable_wayland"
+ATTR{vendor}=="0x102b", ATTR{device}=="0x0538", GOTO="gdm_disable_wayland"
+
+# disable Wayland on aspeed chipsets
+ATTR{vendor}=="0x1a03", ATTR{device}=="0x2010", GOTO="gdm_disable_wayland"
+ATTR{vendor}=="0x1a03", ATTR{device}=="0x2000", GOTO="gdm_disable_wayland"
+
+LABEL="gdm_pci_device_end"
+
# disable Wayland if modesetting is disabled

7
SOURCES/gdm-tmpfiles.conf

@ -0,0 +1,7 @@ @@ -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 - -

59
SPECS/gdm.spec

@ -11,13 +11,14 @@ @@ -11,13 +11,14 @@
Name: gdm
Epoch: 1
Version: 40.1
Release: 13%{?dist}.2
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 @@ -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
@ -119,7 +122,7 @@ Requires: pam >= 0:%{pam_version} @@ -119,7 +122,7 @@ Requires: pam >= 0:%{pam_version}
Requires: /sbin/nologin
Requires: setxkbmap
Requires: systemd >= 186
#Requires: system-logos
Requires: system-logos
Requires: xhost xmodmap xrdb
Requires: xorg-x11-xinit

@ -167,6 +170,7 @@ GDM specific authentication features. @@ -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 @@ -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 || : @@ -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,18 +351,47 @@ dconf update || : @@ -345,18 +351,47 @@ dconf update || :
%{_libdir}/pkgconfig/gdm-pam-extensions.pc

%changelog
* Thu Mar 24 2022 Ray Strode <rstrode@redhat.com> - 40.1-13.2
- Fix erroneous jump back to login screen on udev events after login
Resolves: #2065901
* Fri Jan 27 2023 Ray Strode <rstrode@redhat.com> - 40.1-21
- Enable IPV6 support
Resolves: #2165049

* Wed Jan 18 2023 Ray Strode <rstrode@redhat.com> - 40.1-20
- Ensure /run/gdm and other gdm directories are created at boot up
Resolves: #2047942

* Wed Jan 11 2023 Ray Strode <rstrode@redhat.com> - 40.1-19
- Re-enable Wayland on aspeed
Resolves: #2131203

* Wed Mar 09 2022 Ray Strode <rstrode@redhat.com> - 40.1-13.1
* Wed Nov 02 2022 Ray Strode <rstrode@redhat.com> - 40.1-18
- Fix btmp accounting
Resolves: #2073275

* Thu Sep 29 2022 Ray Strode <rstrode@redhat.com> - 40.1-17
- Disable Wayland on aspeed
Related: #2097308

* Tue Apr 12 2022 Ray Strode <rstrode@redhat.com> - 40.1-16
- Reenable Wayland for matrox and aspeed
Resolves: #2097308

* Tue Apr 12 2022 Ray Strode <rstrode@redhat.com> - 40.1-15
- Fix accountsservice user templates
Resolves: #2057483
Resolves: #2062827
- Properly force Xorg on matrox cards
Related: #2074013
- Fix typo that prevents the correct session type from being
used when user switching.
Resolves: #2074014

* Tue Mar 22 2022 Ray Strode <rstrode@redhat.com> - 40.1-14
- Fix erroneous jump back to login screen on udev events after login
Resolves: #2065901

* Mon Mar 07 2022 Ray Strode <rstrode@redhat.com> - 40.1-13
- Pull in latest udev rules and race fixes for handling
udev rules.
Related: #2017938
Related: #2060793

* Tue Feb 22 2022 Ray Strode <rstrode@redhat.com> - 40.1-12
- More fixes from RHEL 8:

Loading…
Cancel
Save