summaryrefslogtreecommitdiff
path: root/daemon/gdm-session-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/gdm-session-record.c')
-rw-r--r--daemon/gdm-session-record.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/daemon/gdm-session-record.c b/daemon/gdm-session-record.c
index 3b41f9c1..ca2fc2bc 100644
--- a/daemon/gdm-session-record.c
+++ b/daemon/gdm-session-record.c
@@ -149,15 +149,21 @@ record_set_line (UTMP *u,
{
/*
* Set ut_line to the device name associated with this display
- * but remove the "/dev/" prefix. If no device, then use the
- * $DISPLAY value.
+ * but remove the "/dev/" prefix if there is one. Otherwise, if it
+ * seems like the display device is a seat id, just use it wholesale.
+ * If there's no device at all, but $DISPLAY is set, just fall back to
+ * using that.
*/
- 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,