[gdm] slave: don't jump to text vts



commit a607500107b595459a54a045b20c1a5828b66d92
Author: Ray Strode <rstrode redhat com>
Date:   Thu Mar 22 10:54:43 2012 -0400

    slave: don't jump to text vts
    
    commit fb6a3cf203c7fda3a9a33d3e3b4e7a7b868cb43e fixed
    user-switching so that we always migrate to a pre-existing
    session if it's runninng.
    
    Unfortunately, we didn't filter out tty sessions.
    
    This commit ensures GDM only jumps to graphical sessions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=672630

 daemon/gdm-slave.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-slave.c b/daemon/gdm-slave.c
index f1f4c47..6e1b45c 100644
--- a/daemon/gdm-slave.c
+++ b/daemon/gdm-slave.c
@@ -1344,9 +1344,28 @@ gdm_slave_get_primary_session_id_for_user_from_systemd (GdmSlave   *slave,
         }
 
         for (i = 0; sessions[i] != NULL; i++) {
+                char *type;
                 gboolean is_active;
+                gboolean is_x11;
                 uid_t other;
 
+                res = sd_session_get_type (sessions[i], &type);
+
+                if (res < 0) {
+                        g_warning ("GdmSlave: could not fetch type of session '%s': %s",
+                                   sessions[i], strerror (-res));
+                        continue;
+                }
+
+                is_x11 = g_strcmp0 (type, "x11") == 0;
+                g_free (type);
+
+                /* Only migrate to graphical sessions
+                 */
+                if (!is_x11) {
+                        continue;
+                }
+
                 /* Always give preference to non-active sessions,
                  * so we migrate when we can and don't when we can't
                  */



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