[gdm] session-record: support NULL display name if tty available



commit 1edb0e4ae897cb1c53af3f3b2b913d5baf731580
Author: Ray Strode <rstrode redhat com>
Date:   Thu Apr 2 11:33:20 2015 -0400

    session-record: support NULL display name if tty available
    
    wayland sessions don't necessarily have a display name, so this
    commit just uses the display device instead.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=747169

 daemon/gdm-manager.c        |    2 +-
 daemon/gdm-session-record.c |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
index 1eadcd4..0dfce86 100644
--- a/daemon/gdm-manager.c
+++ b/daemon/gdm-manager.c
@@ -1085,7 +1085,7 @@ add_session_record (GdmManager    *manager,
                       "display-device", &display_device,
                       NULL);
 
-        if (display_name == NULL) {
+        if (display_name == NULL && display_device == NULL) {
                 goto out;
         }
 
diff --git a/daemon/gdm-session-record.c b/daemon/gdm-session-record.c
index 1585ef5..da824aa 100644
--- a/daemon/gdm-session-record.c
+++ b/daemon/gdm-session-record.c
@@ -205,6 +205,9 @@ gdm_session_record_login (GPid                  session_pid,
         UTMP        session_record = { 0 };
         UTMP       *u;
 
+        if (x11_display_name == NULL)
+                x11_display_name = display_device;
+
         record_set_username (&session_record, user_name);
 
         g_debug ("Writing login record");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]