import CS gdm-40.1-42.el9
This commit is contained in:
parent
5bdaeddc5e
commit
9d42bc2dc6
@ -1,7 +1,7 @@
|
||||
From e204ee23d7626ee09684494b49774d8fae4d6056 Mon Sep 17 00:00:00 2001
|
||||
From: Joan Torres <joantolo@redhat.com>
|
||||
Date: Thu, 8 May 2025 11:27:03 +0200
|
||||
Subject: [PATCH 1/3] manager: Use full verification on incompatible login
|
||||
Subject: [PATCH 1/4] manager: Use full verification on incompatible login
|
||||
session
|
||||
|
||||
Two sessions are incompatible if they don't share the same
|
||||
@ -142,7 +142,7 @@ index 9c10adff3..051420ac8 100644
|
||||
From 239aefa42bcba99fa7eac12b98b4dd7f64ef9608 Mon Sep 17 00:00:00 2001
|
||||
From: Joan Torres <joantolo@redhat.com>
|
||||
Date: Thu, 8 May 2025 11:50:26 +0200
|
||||
Subject: [PATCH 2/3] session: Stop conflicting session
|
||||
Subject: [PATCH 2/4] session: Stop conflicting session
|
||||
|
||||
This happens when at the login gnome-shell it's been displayed the dialog
|
||||
requesting to logout the existing session. When the user chose to stop
|
||||
@ -376,7 +376,7 @@ index 137be5e27..e5a1e4bb3 100644
|
||||
From b70145ecaabe57e947bfb703bbd5d2e7b953609d Mon Sep 17 00:00:00 2001
|
||||
From: Joan Torres <joantolo@redhat.com>
|
||||
Date: Thu, 8 May 2025 11:52:40 +0200
|
||||
Subject: [PATCH 3/3] session: On greeter add SessionOpenedWithSessionId signal
|
||||
Subject: [PATCH 3/4] session: On greeter add SessionOpenedWithSessionId signal
|
||||
|
||||
This session_id will be used by the gnome-shell at login session when
|
||||
searching if there's already a user session opened, ignoring this one which is
|
||||
@ -420,3 +420,110 @@ index f22e37c8c..9ba2fb213 100644
|
||||
--
|
||||
2.49.0
|
||||
|
||||
From c2d9ef68043a0a045b91a164071a7296d6db9017 Mon Sep 17 00:00:00 2001
|
||||
From: Joan Torres <joantolo@redhat.com>
|
||||
Date: Fri, 6 Mar 2026 16:40:01 +0100
|
||||
Subject: [PATCH 4/4] manager: Pass opened session ID to stop-conflicting-session
|
||||
signal
|
||||
|
||||
Track the session ID when a session is opened and pass it to the
|
||||
stop-conflicting-session signal handler. This allows properly
|
||||
identifying and terminating conflicting sessions, including remote
|
||||
sessions started outside of GDM.
|
||||
|
||||
Previously, sessions were only terminated if they were tracked in the
|
||||
display store, which missed remote sessions not managed by GDM.
|
||||
---
|
||||
daemon/gdm-manager.c | 8 ++------
|
||||
daemon/gdm-session.c | 14 ++++++++++++--
|
||||
2 files changed, 14 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index b904f93..6eb581d 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -2175,6 +2175,7 @@ on_session_reauthenticated (GdmSession *session,
|
||||
static void
|
||||
on_stop_conflicting_session (GdmSession *login_session,
|
||||
const char *username,
|
||||
+ const char *opened_session_id,
|
||||
GdmManager *manager)
|
||||
{
|
||||
g_auto (GStrv) session_ids = NULL;
|
||||
@@ -2190,12 +2191,7 @@ on_stop_conflicting_session (GdmSession *login_session,
|
||||
}
|
||||
|
||||
for (i = 0; i < g_strv_length (session_ids); i++) {
|
||||
- // Don't kill conflicting session if it's not tracked,
|
||||
- // this ensures the new session isn't killed (because
|
||||
- // it's considered a conflicting session).
|
||||
- if (!gdm_display_store_find (manager->priv->display_store,
|
||||
- lookup_by_session_id,
|
||||
- (gpointer) session_ids[i]))
|
||||
+ if (g_strcmp0 (opened_session_id, session_ids[i]) == 0)
|
||||
continue;
|
||||
|
||||
if (!gdm_terminate_session_by_id (manager->priv->connection, NULL, session_ids[i]))
|
||||
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
|
||||
index 5e57a38..9a332d7 100644
|
||||
--- a/daemon/gdm-session.c
|
||||
+++ b/daemon/gdm-session.c
|
||||
@@ -138,6 +138,8 @@ struct _GdmSession
|
||||
guint32 is_program_session : 1;
|
||||
guint32 display_is_initial : 1;
|
||||
guint32 is_opened : 1;
|
||||
+
|
||||
+ char *session_opened;
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -895,6 +897,9 @@ on_opened (GdmDBusWorker *worker,
|
||||
|
||||
conversation->session_id = g_strdup (session_id);
|
||||
|
||||
+ g_clear_pointer (&self->session_opened, g_free);
|
||||
+ self->session_opened = g_strdup (session_id);
|
||||
+
|
||||
if (self->user_verifier_interface != NULL) {
|
||||
gdm_dbus_user_verifier_emit_verification_complete (self->user_verifier_interface,
|
||||
service_name);
|
||||
@@ -1607,7 +1612,7 @@ gdm_session_handle_client_stop_conflicting_session (GdmDBusGreeter *greet
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
- g_signal_emit (self, signals[STOP_CONFLICTING_SESSION], 0, self->selected_user);
|
||||
+ g_signal_emit (self, signals[STOP_CONFLICTING_SESSION], 0, self->selected_user, self->session_opened);
|
||||
|
||||
if (self->greeter_interface != NULL) {
|
||||
gdm_dbus_greeter_complete_stop_conflicting_session (self->greeter_interface,
|
||||
@@ -3058,6 +3063,9 @@ do_reset (GdmSession *self)
|
||||
g_free (self->user_x11_authority_file);
|
||||
self->user_x11_authority_file = NULL;
|
||||
|
||||
+ g_free (self->session_opened);
|
||||
+ self->session_opened = NULL;
|
||||
+
|
||||
g_hash_table_remove_all (self->environment);
|
||||
|
||||
self->session_pid = -1;
|
||||
@@ -3732,6 +3740,7 @@ gdm_session_finalize (GObject *object)
|
||||
g_free (self->selected_session);
|
||||
g_free (self->saved_session);
|
||||
g_free (self->saved_language);
|
||||
+ g_free (self->session_opened);
|
||||
|
||||
g_free (self->fallback_session_name);
|
||||
|
||||
@@ -4006,7 +4015,8 @@ gdm_session_class_init (GdmSessionClass *session_class)
|
||||
NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE,
|
||||
- 1,
|
||||
+ 2,
|
||||
+ G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
--
|
||||
2.51.0
|
||||
|
||||
|
||||
367
SOURCES/0001-Revert-hack-that-quits-plymouth-late.patch
Normal file
367
SOURCES/0001-Revert-hack-that-quits-plymouth-late.patch
Normal file
@ -0,0 +1,367 @@
|
||||
From 8a91856f4020657adcbba67482daa6db373e8ed6 Mon Sep 17 00:00:00 2001
|
||||
From: Adrian Vovk <adrianvovk@gmail.com>
|
||||
Date: Thu, 1 May 2025 15:42:49 -0400
|
||||
Subject: [PATCH 1/2] Revert hack that quits plymouth late
|
||||
|
||||
Reverts 2cbd7ad1f66d0a757c1d2217705436aa1beca76a
|
||||
|
||||
Fixes #375
|
||||
|
||||
Part-of: <https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/285>
|
||||
---
|
||||
daemon/gdm-manager.c | 27 ++++++++-------------------
|
||||
1 file changed, 8 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index b904f93..e04791b 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -175,7 +175,7 @@ plymouth_prepare_for_transition (void)
|
||||
}
|
||||
}
|
||||
|
||||
-static gboolean
|
||||
+static void
|
||||
plymouth_quit_with_transition (void)
|
||||
{
|
||||
gboolean res;
|
||||
@@ -187,8 +187,6 @@ plymouth_quit_with_transition (void)
|
||||
g_warning ("Could not quit plymouth: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
-
|
||||
- return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1641,6 +1639,13 @@ on_display_status_changed (GdmDisplay *display,
|
||||
set_up_session (manager, display);
|
||||
g_free (session_class);
|
||||
}
|
||||
+
|
||||
+#ifdef WITH_PLYMOUTH
|
||||
+ if (status == GDM_DISPLAY_MANAGED && quit_plymouth) {
|
||||
+ plymouth_quit_with_transition ();
|
||||
+ manager->priv->plymouth_is_running = FALSE;
|
||||
+ }
|
||||
+#endif
|
||||
break;
|
||||
|
||||
case GDM_DISPLAY_FAILING:
|
||||
@@ -2060,15 +2065,6 @@ on_user_session_started (GdmSession *session,
|
||||
{
|
||||
g_debug ("GdmManager: session started %d", pid);
|
||||
add_session_record (manager, session, pid, SESSION_RECORD_LOGIN);
|
||||
-
|
||||
-#ifdef WITH_PLYMOUTH
|
||||
- if (g_strcmp0 (service_name, "gdm-autologin") == 0) {
|
||||
- if (manager->priv->plymouth_is_running) {
|
||||
- g_timeout_add_seconds (20, (GSourceFunc) plymouth_quit_with_transition, NULL);
|
||||
- manager->priv->plymouth_is_running = FALSE;
|
||||
- }
|
||||
- }
|
||||
-#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2261,13 +2257,6 @@ on_session_client_connected (GdmSession *session,
|
||||
return;
|
||||
}
|
||||
|
||||
-#ifdef WITH_PLYMOUTH
|
||||
- if (manager->priv->plymouth_is_running) {
|
||||
- plymouth_quit_with_transition ();
|
||||
- manager->priv->plymouth_is_running = FALSE;
|
||||
- }
|
||||
-#endif
|
||||
-
|
||||
g_object_get (G_OBJECT (display), "allow-timed-login", &allow_timed_login, NULL);
|
||||
|
||||
if (!allow_timed_login) {
|
||||
--
|
||||
2.51.0
|
||||
|
||||
From deeb4b8aba46e37a1f6dcb85252ed713183cb170 Mon Sep 17 00:00:00 2001
|
||||
From: Adrian Vovk <adrianvovk@gmail.com>
|
||||
Date: Thu, 1 May 2025 16:13:53 -0400
|
||||
Subject: [PATCH 2/2] manager: Combine register display with register session
|
||||
|
||||
Before we'd always register the display as soon as the session was
|
||||
started. However, this is too early for Wayland! The compositor might
|
||||
not have completely initialized its Wayland connection yet, so the
|
||||
display isn't really open.
|
||||
|
||||
The "register display" should happen when the compositor is up and
|
||||
running. This occurs when it calls RegisterSession, so it makes sense
|
||||
to combine both.
|
||||
|
||||
This helps on terminating plymouthd when the new session has been
|
||||
started, and also kill background greeters.
|
||||
|
||||
Part-of: <https://gitlab.gnome.org/GNOME/gdm/-/merge_requests/285>
|
||||
---
|
||||
daemon/gdm-local-display-factory.c | 33 ++++-----------------
|
||||
daemon/gdm-manager.c | 47 ++++++------------------------
|
||||
daemon/gdm-manager.xml | 3 --
|
||||
daemon/gdm-wayland-session.c | 31 --------------------
|
||||
daemon/gdm-x-session.c | 32 --------------------
|
||||
5 files changed, 15 insertions(+), 131 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c
|
||||
index 51f6f34..ef2ff7c 100644
|
||||
--- a/daemon/gdm-local-display-factory.c
|
||||
+++ b/daemon/gdm-local-display-factory.c
|
||||
@@ -506,25 +506,6 @@ on_finish_waiting_for_seat0_displays_timeout (GdmLocalDisplayFactory *factory)
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
-static void
|
||||
-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,
|
||||
@@ -537,6 +518,7 @@ on_display_status_changed (GdmDisplay *display,
|
||||
char *session_class = NULL;
|
||||
gboolean is_initial = TRUE;
|
||||
gboolean is_local = TRUE;
|
||||
+ gboolean registered = FALSE;
|
||||
|
||||
|
||||
if (!factory->is_started)
|
||||
@@ -602,14 +584,11 @@ on_display_status_changed (GdmDisplay *display,
|
||||
break;
|
||||
case GDM_DISPLAY_MANAGED:
|
||||
#if defined(ENABLE_USER_DISPLAY_SERVER)
|
||||
- g_signal_handlers_disconnect_by_func (display,
|
||||
- G_CALLBACK (on_session_registered_cb),
|
||||
- factory);
|
||||
- g_signal_connect_object (display,
|
||||
- "notify::session-registered",
|
||||
- G_CALLBACK (on_session_registered_cb),
|
||||
- factory,
|
||||
- 0);
|
||||
+ g_object_get (display, "session-registered", ®istered, NULL);
|
||||
+ if (registered) {
|
||||
+ g_debug ("GdmLocalDisplayFactory: session registered on display, looking for any background displays to kill");
|
||||
+ finish_waiting_displays_on_seat (factory, "seat0");
|
||||
+ }
|
||||
#endif
|
||||
break;
|
||||
case GDM_DISPLAY_WAITING_TO_FINISH:
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index 3c60c82..dce431e 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -747,7 +747,7 @@ find_user_session_for_display (GdmManager *self,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
-gdm_manager_handle_register_display (GdmDBusManager *manager,
|
||||
+gdm_manager_handle_register_session (GdmDBusManager *manager,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *details)
|
||||
{
|
||||
@@ -759,15 +759,15 @@ gdm_manager_handle_register_display (GdmDBusManager *manager,
|
||||
GVariantIter iter;
|
||||
char *key = NULL;
|
||||
char *value = NULL;
|
||||
- char *x11_display_name = NULL;
|
||||
- char *tty = NULL;
|
||||
-
|
||||
- g_debug ("GdmManager: trying to register new display");
|
||||
+ g_autofree char *x11_display_name = NULL;
|
||||
+ g_autofree char *tty = NULL;
|
||||
|
||||
sender = g_dbus_method_invocation_get_sender (invocation);
|
||||
connection = g_dbus_method_invocation_get_connection (invocation);
|
||||
get_display_and_details_for_bus_sender (self, connection, sender, &display, NULL, NULL, &tty, NULL, NULL, NULL, NULL);
|
||||
|
||||
+ g_debug ("GdmManager: trying to register new session on display %p", display);
|
||||
+
|
||||
if (display == NULL) {
|
||||
g_dbus_method_invocation_return_error_literal (invocation,
|
||||
G_DBUS_ERROR,
|
||||
@@ -807,38 +807,10 @@ gdm_manager_handle_register_display (GdmDBusManager *manager,
|
||||
}
|
||||
}
|
||||
|
||||
- g_object_set (G_OBJECT (display), "status", GDM_DISPLAY_MANAGED, NULL);
|
||||
-
|
||||
- gdm_dbus_manager_complete_register_display (GDM_DBUS_MANAGER (manager),
|
||||
- invocation);
|
||||
-
|
||||
- g_clear_pointer (&x11_display_name, g_free);
|
||||
- g_clear_pointer (&tty, g_free);
|
||||
- return TRUE;
|
||||
-}
|
||||
-
|
||||
-static gboolean
|
||||
-gdm_manager_handle_register_session (GdmDBusManager *manager,
|
||||
- GDBusMethodInvocation *invocation,
|
||||
- GVariant *details)
|
||||
-{
|
||||
- GdmManager *self = GDM_MANAGER (manager);
|
||||
- GdmDisplay *display = NULL;
|
||||
- const char *sender;
|
||||
- GDBusConnection *connection;
|
||||
-
|
||||
- sender = g_dbus_method_invocation_get_sender (invocation);
|
||||
- connection = g_dbus_method_invocation_get_connection (invocation);
|
||||
-
|
||||
- get_display_and_details_for_bus_sender (self, connection, sender, &display,
|
||||
- NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
-
|
||||
- g_debug ("GdmManager: trying to register new session on display %p", display);
|
||||
-
|
||||
- if (display != NULL)
|
||||
- g_object_set (G_OBJECT (display), "session-registered", TRUE, NULL);
|
||||
- else
|
||||
- g_debug ("GdmManager: No display, not registering");
|
||||
+ g_object_set (G_OBJECT (display),
|
||||
+ "status", GDM_DISPLAY_MANAGED,
|
||||
+ "session-registered", TRUE,
|
||||
+ NULL);
|
||||
|
||||
gdm_dbus_manager_complete_register_session (GDM_DBUS_MANAGER (manager),
|
||||
invocation);
|
||||
@@ -1292,7 +1264,6 @@ gdm_manager_handle_open_reauthentication_channel (GdmDBusManager *manager
|
||||
static void
|
||||
manager_interface_init (GdmDBusManagerIface *interface)
|
||||
{
|
||||
- interface->handle_register_display = gdm_manager_handle_register_display;
|
||||
interface->handle_register_session = gdm_manager_handle_register_session;
|
||||
interface->handle_open_session = gdm_manager_handle_open_session;
|
||||
interface->handle_open_reauthentication_channel = gdm_manager_handle_open_reauthentication_channel;
|
||||
diff --git a/daemon/gdm-manager.xml b/daemon/gdm-manager.xml
|
||||
index 92ef1d0..aba079a 100644
|
||||
--- a/daemon/gdm-manager.xml
|
||||
+++ b/daemon/gdm-manager.xml
|
||||
@@ -1,9 +1,6 @@
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
<node name="/org/gnome/DisplayManager/Manager">
|
||||
<interface name="org.gnome.DisplayManager.Manager">
|
||||
- <method name="RegisterDisplay">
|
||||
- <arg name="details" direction="in" type="a{ss}"/>
|
||||
- </method>
|
||||
<method name="RegisterSession">
|
||||
<arg name="details" direction="in" type="a{sv}"/>
|
||||
</method>
|
||||
diff --git a/daemon/gdm-wayland-session.c b/daemon/gdm-wayland-session.c
|
||||
index d0404d2..d4d1edd 100644
|
||||
--- a/daemon/gdm-wayland-session.c
|
||||
+++ b/daemon/gdm-wayland-session.c
|
||||
@@ -404,29 +404,6 @@ wait_on_subprocesses (State *state)
|
||||
}
|
||||
}
|
||||
|
||||
-static gboolean
|
||||
-register_display (State *state,
|
||||
- GCancellable *cancellable)
|
||||
-{
|
||||
- GError *error = NULL;
|
||||
- gboolean registered = FALSE;
|
||||
- GVariantBuilder details;
|
||||
-
|
||||
- g_variant_builder_init (&details, G_VARIANT_TYPE ("a{ss}"));
|
||||
- g_variant_builder_add (&details, "{ss}", "session-type", "wayland");
|
||||
-
|
||||
- registered = gdm_dbus_manager_call_register_display_sync (state->display_manager_proxy,
|
||||
- g_variant_builder_end (&details),
|
||||
- cancellable,
|
||||
- &error);
|
||||
- if (error != NULL) {
|
||||
- g_debug ("Could not register display: %s", error->message);
|
||||
- g_error_free (error);
|
||||
- }
|
||||
-
|
||||
- return registered;
|
||||
-}
|
||||
-
|
||||
static void
|
||||
init_state (State **state)
|
||||
{
|
||||
@@ -584,14 +561,6 @@ main (int argc,
|
||||
if (!connect_to_display_manager (state))
|
||||
goto out;
|
||||
|
||||
- ret = register_display (state, state->cancellable);
|
||||
-
|
||||
- if (!ret) {
|
||||
- g_printerr ("Unable to register display with display manager\n");
|
||||
- exit_status = EX_SOFTWARE;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
if (register_session) {
|
||||
g_debug ("gdm-wayland-session: Will register session in %d seconds", REGISTER_SESSION_TIMEOUT);
|
||||
state->register_session_id = g_timeout_add_seconds (REGISTER_SESSION_TIMEOUT,
|
||||
diff --git a/daemon/gdm-x-session.c b/daemon/gdm-x-session.c
|
||||
index 0b07ab5..36b3975 100644
|
||||
--- a/daemon/gdm-x-session.c
|
||||
+++ b/daemon/gdm-x-session.c
|
||||
@@ -757,30 +757,6 @@ wait_on_subprocesses (State *state)
|
||||
}
|
||||
}
|
||||
|
||||
-static gboolean
|
||||
-register_display (State *state,
|
||||
- GCancellable *cancellable)
|
||||
-{
|
||||
- GError *error = NULL;
|
||||
- gboolean registered = FALSE;
|
||||
- GVariantBuilder details;
|
||||
-
|
||||
- g_variant_builder_init (&details, G_VARIANT_TYPE ("a{ss}"));
|
||||
- g_variant_builder_add (&details, "{ss}", "session-type", "x11");
|
||||
- g_variant_builder_add (&details, "{ss}", "x11-display-name", state->display_name);
|
||||
-
|
||||
- registered = gdm_dbus_manager_call_register_display_sync (state->display_manager_proxy,
|
||||
- g_variant_builder_end (&details),
|
||||
- cancellable,
|
||||
- &error);
|
||||
- if (error != NULL) {
|
||||
- g_debug ("Could not register display: %s", error->message);
|
||||
- g_error_free (error);
|
||||
- }
|
||||
-
|
||||
- return registered;
|
||||
-}
|
||||
-
|
||||
static void
|
||||
init_state (State **state)
|
||||
{
|
||||
@@ -953,14 +929,6 @@ main (int argc,
|
||||
if (!connect_to_display_manager (state))
|
||||
goto out;
|
||||
|
||||
- ret = register_display (state, state->cancellable);
|
||||
-
|
||||
- if (!ret) {
|
||||
- g_printerr ("Unable to register display with display manager\n");
|
||||
- exit_status = EX_SOFTWARE;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
ret = spawn_session (state, run_script, state->cancellable);
|
||||
|
||||
if (!ret) {
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@ -26,7 +26,7 @@ index 134b9bc..ab2a87f 100644
|
||||
<filename><etc>/dm/</filename> unless GDM is configured to use
|
||||
a different directory via the "--with-dmconfdir" option.
|
||||
diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
|
||||
index f078e04..e4a0e6b 100644
|
||||
index d8b4d5c..13067ec 100644
|
||||
--- a/libgdm/gdm-sessions.c
|
||||
+++ b/libgdm/gdm-sessions.c
|
||||
@@ -275,7 +275,6 @@ collect_sessions (void)
|
||||
@ -35,9 +35,9 @@ index f078e04..e4a0e6b 100644
|
||||
DATADIR "/gdm/BuiltInSessions/",
|
||||
- DATADIR "/xsessions/",
|
||||
};
|
||||
const gchar *supported_session_types_env = NULL;
|
||||
g_auto (GStrv) supported_session_types = NULL;
|
||||
|
||||
@@ -296,20 +295,12 @@ collect_sessions (void)
|
||||
@@ -300,20 +299,12 @@ collect_sessions (void)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WAYLAND_SUPPORT
|
||||
@ -58,9 +58,6 @@ index f078e04..e4a0e6b 100644
|
||||
#endif
|
||||
|
||||
if (gdm_available_sessions_map == NULL) {
|
||||
--
|
||||
2.50.1
|
||||
|
||||
From ac9d403b5b27cbd8396a696223cd96fbac56f142 Mon Sep 17 00:00:00 2001
|
||||
From: Joan Torres Lopez <joantolo@redhat.com>
|
||||
Date: Mon, 9 Jun 2025 17:11:01 +0200
|
||||
@ -84,7 +81,7 @@ before sessions in /etc/.
|
||||
1 file changed, 19 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/libgdm/gdm-sessions.c b/libgdm/gdm-sessions.c
|
||||
index e4a0e6b..e0d0044 100644
|
||||
index 13067ec..4c3f607 100644
|
||||
--- a/libgdm/gdm-sessions.c
|
||||
+++ b/libgdm/gdm-sessions.c
|
||||
@@ -267,8 +267,7 @@ static void
|
||||
@ -97,8 +94,8 @@ index e4a0e6b..e0d0044 100644
|
||||
gchar *session_dir = NULL;
|
||||
int i;
|
||||
const char *xorg_search_dirs[] = {
|
||||
@@ -281,26 +280,30 @@ collect_sessions (void)
|
||||
supported_session_types = g_strsplit (g_getenv ("GDM_SUPPORTED_SESSION_TYPES"), ":", -1);
|
||||
@@ -285,26 +284,30 @@ collect_sessions (void)
|
||||
}
|
||||
|
||||
names_seen_before = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
- xorg_search_array = g_ptr_array_new_with_free_func (g_free);
|
||||
@ -140,7 +137,7 @@ index e4a0e6b..e0d0044 100644
|
||||
#endif
|
||||
|
||||
if (gdm_available_sessions_map == NULL) {
|
||||
@@ -308,22 +311,10 @@ collect_sessions (void)
|
||||
@@ -312,22 +315,10 @@ collect_sessions (void)
|
||||
g_free, (GDestroyNotify)gdm_session_file_free);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -5,42 +5,15 @@ Subject: [PATCH 1/3] manager: allow multiple xdmcp logins for the same user
|
||||
|
||||
---
|
||||
common/gdm-settings-keys.h | 1 +
|
||||
daemon/gdm-manager.c | 71 ++++++++++++++++++++++++++++----------
|
||||
daemon/gdm-manager.c | 72 ++++++++++++++++++++++++++++----------
|
||||
data/gdm.schemas.in | 5 +++
|
||||
3 files changed, 59 insertions(+), 18 deletions(-)
|
||||
3 files changed, 60 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/common/gdm-settings-keys.h b/common/gdm-settings-keys.h
|
||||
index 87685d3c..4b3a1ffe 100644
|
||||
index 87685d3..4b3a1ff 100644
|
||||
--- a/common/gdm-settings-keys.h
|
||||
+++ b/common/gdm-settings-keys.h
|
||||
@@ -30,37 +30,38 @@ G_BEGIN_DECLS
|
||||
#define GDM_KEY_AUTO_LOGIN_ENABLE "daemon/AutomaticLoginEnable"
|
||||
#define GDM_KEY_AUTO_LOGIN_USER "daemon/AutomaticLogin"
|
||||
#define GDM_KEY_TIMED_LOGIN_ENABLE "daemon/TimedLoginEnable"
|
||||
#define GDM_KEY_TIMED_LOGIN_USER "daemon/TimedLogin"
|
||||
#define GDM_KEY_TIMED_LOGIN_DELAY "daemon/TimedLoginDelay"
|
||||
#define GDM_KEY_INITIAL_SETUP_ENABLE "daemon/InitialSetupEnable"
|
||||
#define GDM_KEY_PREFERRED_DISPLAY_SERVER "daemon/PreferredDisplayServer"
|
||||
#define GDM_KEY_WAYLAND_ENABLE "daemon/WaylandEnable"
|
||||
#define GDM_KEY_XORG_ENABLE "daemon/XorgEnable"
|
||||
|
||||
#define GDM_KEY_DEBUG "debug/Enable"
|
||||
|
||||
#define GDM_KEY_INCLUDE "greeter/Include"
|
||||
#define GDM_KEY_EXCLUDE "greeter/Exclude"
|
||||
#define GDM_KEY_INCLUDE_ALL "greeter/IncludeAll"
|
||||
|
||||
#define GDM_KEY_DISALLOW_TCP "security/DisallowTCP"
|
||||
#define GDM_KEY_ALLOW_REMOTE_AUTOLOGIN "security/AllowRemoteAutoLogin"
|
||||
|
||||
#define GDM_KEY_XDMCP_ENABLE "xdmcp/Enable"
|
||||
#define GDM_KEY_SHOW_LOCAL_GREETER "xdmcp/ShowLocalGreeter"
|
||||
#define GDM_KEY_MAX_PENDING "xdmcp/MaxPending"
|
||||
#define GDM_KEY_MAX_SESSIONS "xdmcp/MaxSessions"
|
||||
#define GDM_KEY_MAX_WAIT "xdmcp/MaxWait"
|
||||
#define GDM_KEY_DISPLAYS_PER_HOST "xdmcp/DisplaysPerHost"
|
||||
#define GDM_KEY_UDP_PORT "xdmcp/Port"
|
||||
#define GDM_KEY_INDIRECT "xdmcp/HonorIndirect"
|
||||
@@ -57,6 +57,7 @@ G_BEGIN_DECLS
|
||||
#define GDM_KEY_MAX_WAIT_INDIRECT "xdmcp/MaxWaitIndirect"
|
||||
#define GDM_KEY_PING_INTERVAL "xdmcp/PingIntervalSeconds"
|
||||
#define GDM_KEY_WILLING "xdmcp/Willing"
|
||||
@ -48,42 +21,11 @@ index 87685d3c..4b3a1ffe 100644
|
||||
|
||||
#define GDM_KEY_MULTICAST "chooser/Multicast"
|
||||
#define GDM_KEY_MULTICAST_ADDR "chooser/MulticastAddr"
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* _GDM_SETTINGS_KEYS_H */
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index e1bc62d7..08c3cc17 100644
|
||||
index 681c9f6..2be7d2b 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -566,93 +566,106 @@ get_display_and_details_for_bus_sender (GdmManager *self,
|
||||
*out_tty = get_tty_for_session_id (session_id, &error);
|
||||
|
||||
if (error != NULL) {
|
||||
g_debug ("GdmManager: Error while retrieving tty for session: %s",
|
||||
error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
}
|
||||
|
||||
display = gdm_display_store_find (self->priv->display_store,
|
||||
lookup_by_session_id,
|
||||
(gpointer) session_id);
|
||||
|
||||
out:
|
||||
if (out_display != NULL) {
|
||||
*out_display = display;
|
||||
}
|
||||
|
||||
g_free (session_id);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
switch_to_compatible_user_session (GdmManager *manager,
|
||||
GdmSession *session,
|
||||
gboolean fail_if_already_switched)
|
||||
{
|
||||
gboolean res;
|
||||
@@ -597,7 +597,7 @@ switch_to_compatible_user_session (GdmManager *manager,
|
||||
gboolean ret;
|
||||
const char *username;
|
||||
const char *seat_id;
|
||||
@ -92,7 +34,7 @@ index e1bc62d7..08c3cc17 100644
|
||||
GdmSession *existing_session;
|
||||
|
||||
ret = FALSE;
|
||||
|
||||
@@ -605,31 +605,44 @@ switch_to_compatible_user_session (GdmManager *manager,
|
||||
username = gdm_session_get_username (session);
|
||||
seat_id = gdm_session_get_display_seat_id (session);
|
||||
|
||||
@ -154,34 +96,7 @@ index e1bc62d7..08c3cc17 100644
|
||||
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, *display_seat_id;
|
||||
@@ -1129,6 +1142,21 @@ open_temporary_reauthentication_channel (GdmManager *self,
|
||||
@@ -1077,6 +1090,21 @@ open_temporary_reauthentication_channel (GdmManager *self,
|
||||
return g_strdup (address);
|
||||
}
|
||||
|
||||
@ -203,7 +118,7 @@ index e1bc62d7..08c3cc17 100644
|
||||
static gboolean
|
||||
is_session_graphical (const char *session_id)
|
||||
{
|
||||
@@ -1237,6 +1265,14 @@ gdm_manager_handle_open_reauthentication_channel (GdmDBusManager *manager
|
||||
@@ -1188,6 +1216,14 @@ gdm_manager_handle_open_reauthentication_channel (GdmDBusManager *manager
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -219,37 +134,10 @@ index e1bc62d7..08c3cc17 100644
|
||||
g_debug ("GdmManager: looking for login screen session for user %s on seat %s", username, seat_id);
|
||||
session = find_session_for_user_on_seat (self,
|
||||
diff --git a/data/gdm.schemas.in b/data/gdm.schemas.in
|
||||
index a1035f95..929d13d9 100644
|
||||
index a1035f9..929d13d 100644
|
||||
--- a/data/gdm.schemas.in
|
||||
+++ b/data/gdm.schemas.in
|
||||
@@ -112,33 +112,38 @@
|
||||
<schema>
|
||||
<key>xdmcp/DisplaysPerHost</key>
|
||||
<signature>i</signature>
|
||||
<default>1</default>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>xdmcp/Port</key>
|
||||
<signature>i</signature>
|
||||
<default>177</default>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>xdmcp/HonorIndirect</key>
|
||||
<signature>b</signature>
|
||||
<default>true</default>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>xdmcp/MaxWaitIndirect</key>
|
||||
<signature>i</signature>
|
||||
<default>30</default>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>xdmcp/PingIntervalSeconds</key>
|
||||
<signature>i</signature>
|
||||
<default>0</default>
|
||||
</schema>
|
||||
<schema>
|
||||
<key>xdmcp/Willing</key>
|
||||
@@ -139,6 +139,11 @@
|
||||
<signature>s</signature>
|
||||
<default>@gdmconfdir@/Xwilling</default>
|
||||
</schema>
|
||||
@ -262,5 +150,5 @@ index a1035f95..929d13d9 100644
|
||||
</gdmschemafile>
|
||||
|
||||
--
|
||||
2.37.3
|
||||
2.51.0
|
||||
|
||||
|
||||
350
SOURCES/0001-session-record-Rework-wtmp-utmp-btmp-fields.patch
Normal file
350
SOURCES/0001-session-record-Rework-wtmp-utmp-btmp-fields.patch
Normal file
@ -0,0 +1,350 @@
|
||||
From 161ce350f8acd18ad49ca880667c1f90f2b55d93 Mon Sep 17 00:00:00 2001
|
||||
From: Adrian Vovk <adrianvovk@gmail.com>
|
||||
Date: Wed, 12 Nov 2025 14:59:03 -0500
|
||||
Subject: [PATCH] session-record: Rework wtmp/utmp/btmp fields
|
||||
|
||||
This reworks the logic we use when setting the various fields in the
|
||||
wtmp/utmp/btmp records.
|
||||
|
||||
Previously, we'd set the hostname to "[<remote IP>]:<X11 display>" in
|
||||
the X11 case and to "login screen" on Wayland. We'd also set the "line"
|
||||
(which is supposed to contain the TTY) to the TTY on X11 but the seat ID
|
||||
on Wayland. And finally we simply wouldn't write these records for
|
||||
remote Wayland sessions.
|
||||
|
||||
Now: the hostname is always just a remote IP address for remote
|
||||
sessions, and the string "local" for local sessions. The "line" is also
|
||||
consistently set to the TTY, or the seat ID if no TTY is available, or
|
||||
the string "headless" if no seat is set and the session is headless.
|
||||
Also Wayland remote sessions are supported properly now.
|
||||
|
||||
This also happens to get rid of this code's dependency on X11: we no
|
||||
longer consider the X11 display name
|
||||
|
||||
Co-authored-by: Joan Torres Lopez <joantolo@redhat.com>
|
||||
---
|
||||
daemon/gdm-manager.c | 47 ++++----------
|
||||
daemon/gdm-session-record.c | 123 ++++++++++++++----------------------
|
||||
daemon/gdm-session-record.h | 13 ++--
|
||||
3 files changed, 64 insertions(+), 119 deletions(-)
|
||||
|
||||
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
|
||||
index 05bbb96..681c9f6 100644
|
||||
--- a/daemon/gdm-manager.c
|
||||
+++ b/daemon/gdm-manager.c
|
||||
@@ -659,68 +659,46 @@ add_session_record (GdmManager *manager,
|
||||
SessionRecord record)
|
||||
{
|
||||
const char *username;
|
||||
- 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;
|
||||
+ g_autofree char *hostname = NULL;
|
||||
+ g_autofree char *display_device = NULL;
|
||||
+ g_autofree char *display_seat_id = NULL;
|
||||
|
||||
username = gdm_session_get_username (session);
|
||||
-
|
||||
- if (username == NULL) {
|
||||
- goto out;
|
||||
- }
|
||||
+ if (username == NULL)
|
||||
+ return FALSE;
|
||||
|
||||
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) {
|
||||
- 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);
|
||||
+ display_device,
|
||||
+ display_seat_id);
|
||||
break;
|
||||
case SESSION_RECORD_LOGOUT:
|
||||
gdm_session_record_logout (pid,
|
||||
username,
|
||||
hostname,
|
||||
- display_name,
|
||||
- display_device);
|
||||
+ display_device,
|
||||
+ display_seat_id);
|
||||
break;
|
||||
case SESSION_RECORD_FAILED:
|
||||
gdm_session_record_failed (pid,
|
||||
username,
|
||||
hostname,
|
||||
- display_name,
|
||||
- display_device);
|
||||
+ display_device,
|
||||
+ display_seat_id);
|
||||
break;
|
||||
}
|
||||
|
||||
- recorded = TRUE;
|
||||
-out:
|
||||
- g_free (display_name);
|
||||
- g_free (hostname);
|
||||
- g_free (display_device);
|
||||
- g_free (display_seat_id);
|
||||
-
|
||||
- return recorded;
|
||||
+ return FALSE;
|
||||
}
|
||||
|
||||
static GdmSession *
|
||||
@@ -2035,7 +2013,6 @@ on_user_session_started (GdmSession *session,
|
||||
GdmManager *manager)
|
||||
{
|
||||
g_debug ("GdmManager: session started %d", pid);
|
||||
- add_session_record (manager, session, pid, SESSION_RECORD_LOGIN);
|
||||
}
|
||||
|
||||
static void
|
||||
diff --git a/daemon/gdm-session-record.c b/daemon/gdm-session-record.c
|
||||
index 310323b..3b549d8 100644
|
||||
--- a/daemon/gdm-session-record.c
|
||||
+++ b/daemon/gdm-session-record.c
|
||||
@@ -111,79 +111,52 @@ record_set_pid (UTMP *u,
|
||||
|
||||
static void
|
||||
record_set_host (UTMP *u,
|
||||
- const char *x11_display_name,
|
||||
- const char *host_name)
|
||||
+ const char *remote_host)
|
||||
{
|
||||
- char *hostname;
|
||||
-
|
||||
+ const char *hostname;
|
||||
#if defined(HAVE_UT_UT_HOST)
|
||||
- hostname = NULL;
|
||||
-
|
||||
- /*
|
||||
- * Set ut_host to hostname:$DISPLAY if remote, otherwise set
|
||||
- * to $DISPLAY
|
||||
- */
|
||||
- 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);
|
||||
+ if (remote_host != NULL)
|
||||
+ hostname = remote_host;
|
||||
+ else
|
||||
+ hostname = "local";
|
||||
+ 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));
|
||||
+ 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)
|
||||
+ const char *tty,
|
||||
+ const char *seat_id)
|
||||
{
|
||||
- /*
|
||||
- * 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/")) {
|
||||
- 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));
|
||||
- }
|
||||
-
|
||||
+ const char *line;
|
||||
+
|
||||
+ if (tty != NULL) {
|
||||
+ if (g_str_has_prefix (tty, "/dev/"))
|
||||
+ line = tty + strlen("/dev/");
|
||||
+ else
|
||||
+ line = tty;
|
||||
+ } else if (seat_id != NULL)
|
||||
+ line = seat_id;
|
||||
+ else
|
||||
+ line = "headless";
|
||||
+
|
||||
+ memccpy (u->ut_line, line, '\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)
|
||||
+gdm_session_record_login (GPid session_pid,
|
||||
+ const char *user_name,
|
||||
+ const char *host_name,
|
||||
+ const char *tty,
|
||||
+ const char *seat_id)
|
||||
{
|
||||
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");
|
||||
@@ -195,8 +168,8 @@ gdm_session_record_login (GPid session_pid,
|
||||
|
||||
record_set_timestamp (&session_record);
|
||||
record_set_pid (&session_record, session_pid);
|
||||
- record_set_host (&session_record, x11_display_name, host_name);
|
||||
- record_set_line (&session_record, display_device, x11_display_name);
|
||||
+ record_set_host (&session_record, host_name);
|
||||
+ record_set_line (&session_record, tty, seat_id);
|
||||
|
||||
/* Handle wtmp */
|
||||
g_debug ("Writing wtmp session record to " GDM_NEW_SESSION_RECORDS_FILE);
|
||||
@@ -224,16 +197,15 @@ gdm_session_record_login (GPid session_pid,
|
||||
}
|
||||
|
||||
void
|
||||
-gdm_session_record_logout (GPid session_pid,
|
||||
- const char *user_name,
|
||||
- const char *host_name,
|
||||
- const char *x11_display_name,
|
||||
- const char *display_device)
|
||||
+gdm_session_record_logout (GPid session_pid,
|
||||
+ const char *user_name,
|
||||
+ const char *host_name,
|
||||
+ const char *tty,
|
||||
+ const char *seat_id)
|
||||
{
|
||||
UTMP session_record = { 0 };
|
||||
|
||||
- if (x11_display_name == NULL)
|
||||
- x11_display_name = display_device;
|
||||
+ record_set_username (&session_record, user_name);
|
||||
|
||||
g_debug ("Writing logout record");
|
||||
|
||||
@@ -244,8 +216,8 @@ gdm_session_record_logout (GPid session_pid,
|
||||
|
||||
record_set_timestamp (&session_record);
|
||||
record_set_pid (&session_record, session_pid);
|
||||
- record_set_host (&session_record, x11_display_name, host_name);
|
||||
- record_set_line (&session_record, display_device, x11_display_name);
|
||||
+ record_set_host (&session_record, host_name);
|
||||
+ record_set_line (&session_record, tty, seat_id);
|
||||
|
||||
/* Handle wtmp */
|
||||
g_debug ("Writing wtmp logout record to " GDM_NEW_SESSION_RECORDS_FILE);
|
||||
@@ -269,17 +241,14 @@ gdm_session_record_logout (GPid session_pid,
|
||||
}
|
||||
|
||||
void
|
||||
-gdm_session_record_failed (GPid session_pid,
|
||||
- const char *user_name,
|
||||
- const char *host_name,
|
||||
- const char *x11_display_name,
|
||||
- const char *display_device)
|
||||
+gdm_session_record_failed (GPid session_pid,
|
||||
+ const char *user_name,
|
||||
+ const char *host_name,
|
||||
+ const char *tty,
|
||||
+ const char *seat_id)
|
||||
{
|
||||
UTMP session_record = { 0 };
|
||||
|
||||
- if (x11_display_name == NULL)
|
||||
- x11_display_name = display_device;
|
||||
-
|
||||
record_set_username (&session_record, user_name);
|
||||
|
||||
g_debug ("Writing failed session attempt record");
|
||||
@@ -291,8 +260,8 @@ gdm_session_record_failed (GPid session_pid,
|
||||
|
||||
record_set_timestamp (&session_record);
|
||||
record_set_pid (&session_record, session_pid);
|
||||
- record_set_host (&session_record, x11_display_name, host_name);
|
||||
- record_set_line (&session_record, display_device, x11_display_name);
|
||||
+ record_set_host (&session_record, host_name);
|
||||
+ record_set_line (&session_record, tty, seat_id);
|
||||
|
||||
#if defined(HAVE_UPDWTMPX) || defined(HAVE_UPDWTMP)
|
||||
/* Handle btmp */
|
||||
diff --git a/daemon/gdm-session-record.h b/daemon/gdm-session-record.h
|
||||
index 3c53268..bbe323a 100644
|
||||
--- a/daemon/gdm-session-record.h
|
||||
+++ b/daemon/gdm-session-record.h
|
||||
@@ -29,21 +29,20 @@ 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);
|
||||
+ const char *tty,
|
||||
+ const char *seat_id);
|
||||
void
|
||||
gdm_session_record_logout (GPid session_pid,
|
||||
const char *user_name,
|
||||
const char *host_name,
|
||||
- const char *x11_display_name,
|
||||
- const char *display_device);
|
||||
+ const char *tty,
|
||||
+ const char *seat_id);
|
||||
void
|
||||
gdm_session_record_failed (GPid session_pid,
|
||||
const char *user_name,
|
||||
const char *host_name,
|
||||
- const char *x11_display_name,
|
||||
- const char *display_device);
|
||||
-
|
||||
+ const char *tty,
|
||||
+ const char *seat_id);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
--
|
||||
2.51.0
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
Name: gdm
|
||||
Epoch: 1
|
||||
Version: 40.1
|
||||
Release: 38%{?dist}
|
||||
Release: 42%{?dist}
|
||||
Summary: The GNOME Display Manager
|
||||
|
||||
License: GPLv2+
|
||||
@ -70,6 +70,10 @@ Patch140001: 0001-session-Fix-memory-leak-on-new-outside-connection.patch
|
||||
|
||||
Patch150001: 0001-libgdm-Don-t-collect-twice-sessions-on-usr-share.patch
|
||||
|
||||
Patch160001: 0001-Revert-hack-that-quits-plymouth-late.patch
|
||||
|
||||
Patch170001: 0001-session-record-Rework-wtmp-utmp-btmp-fields.patch
|
||||
|
||||
# Non-upstreamable workarounds
|
||||
Patch66610001: 0001-data-reap-gdm-sessions-on-shutdown.patch
|
||||
|
||||
@ -373,6 +377,22 @@ dconf update || :
|
||||
%{_libdir}/pkgconfig/gdm-pam-extensions.pc
|
||||
|
||||
%changelog
|
||||
* Fri Mar 6 2026 Joan Torres Lopez <joantolo@redhat.com> - 40.1-42
|
||||
- Terminate conflicting sesions started outside of GDM
|
||||
Resolves: RHEL-4108
|
||||
|
||||
* Tue Nov 18 2025 Joan Torres Lopez <joantolo@redhat.com> - 40.1-41
|
||||
- Fix recording wtmp/utmp/btmp
|
||||
Resolves: RHEL-129305
|
||||
|
||||
* Tue Nov 18 2025 Joan Torres Lopez <joantolo@redhat.com> - 40.1-40
|
||||
- Now Plymouth will quit even when no monitor is connected.
|
||||
Resolves: RHEL-129215
|
||||
|
||||
* Fri Oct 31 2025 Joan Torres Lopez <joantolo@redhat.com> - 40.1-39
|
||||
- Fix Handle GDM_SUPPORTED_SESSION_TYPES being unset
|
||||
Resolves: RHEL-117034
|
||||
|
||||
* Thu Oct 2 2025 Joan Torres Lopez <joantolo@redhat.com> - 40.1-38
|
||||
- Fix issue on conflicting sessions when they are remote
|
||||
Resolves: RHEL-123357
|
||||
|
||||
Loading…
Reference in New Issue
Block a user