diff options
author | Ray Strode <rstrode@redhat.com> | 2022-10-19 14:50:33 -0400 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2022-10-27 16:21:52 +0000 |
commit | 151dd072b37babc2e909a9a6a46631cb47e50b8f (patch) | |
tree | f9f63d2fb6940137b9321c081cec13517ca65666 /daemon/gdm-manager.c | |
parent | 002b39bf345b1327159bab0fca053f69e8eb0f95 (diff) | |
download | gdm-151dd072b37babc2e909a9a6a46631cb47e50b8f.tar.gz |
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.
Diffstat (limited to 'daemon/gdm-manager.c')
-rw-r--r-- | daemon/gdm-manager.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c index 1c8e5992..de3ac966 100644 --- a/daemon/gdm-manager.c +++ b/daemon/gdm-manager.c @@ -653,13 +653,14 @@ add_session_record (GdmManager *manager, 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); @@ -671,10 +672,15 @@ add_session_record (GdmManager *manager, "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) { @@ -706,6 +712,7 @@ out: g_free (display_name); g_free (hostname); g_free (display_device); + g_free (display_seat_id); return recorded; } |