[gdm/benzea/fix-multiple-greeter-sessions] session: Always use separate session bus for greeter sessions



commit d95936c078e8fa15eab8b14ffdc76e1987239f25
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Apr 16 15:17:56 2020 +0200

    session: Always use separate session bus for greeter sessions
    
    This is a workaround for the fact that we currently need to run multiple
    greeter sessions in multi-seat environments that use the same user. We
    should not be doing this in the first place. Doing this effectively
    prevents GNOME from using a systemd startup, which would cause relevant
    processes to be outside of the session scope preventing lookups of the
    logind session from the PID.
    
    Instead, we really should be running each of the greeter session as a
    separate (dynamic) user. But lacking that, this workaround should get
    multi-seat support up and running again for the time being.
    
    See: #526

 daemon/gdm-session.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 4e303e70..ca7d98f1 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -2900,23 +2900,33 @@ gdm_session_start_session (GdmSession *self,
 
                 g_free (command);
         } else {
+                /* FIXME:
+                 * Always use a separate DBus bus for each greeter session.
+                 * Firstly, this means that if we run multiple greeter session
+                 * (which we really should not do, but have to currently), then
+                 * each one will get its own DBus session bus.
+                 * But, we also explicitly do this for seat0, because that way
+                 * it cannot make use of systemd to run the GNOME session. This
+                 * prevents the session lookup logic from getting confused.
+                 * This has a similar effect as passing --builtin to gnome-session.
+                 *
+                 * We really should not be doing this. But the fix is to use
+                 * separate dynamically created users and that requires some
+                 * major refactorings.
+                 */
                 if (run_launcher) {
                         if (is_x11) {
-                                program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"%s\"",
+                                program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"dbus-run-session 
-- %s\"",
                                                            register_session ? "--register-session " : "",
                                                            self->selected_program);
                         } else {
-                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
+                                program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session 
%s\"dbus-run-session -- %s\"",
                                                            register_session ? "--register-session " : "",
                                                            self->selected_program);
                         }
                 } else {
-                        if (g_strcmp0 (self->display_seat_id, "seat0") != 0) {
-                                program = g_strdup_printf ("dbus-run-session -- %s",
-                                                           self->selected_program);
-                        } else {
-                                program = g_strdup (self->selected_program);
-                        }
+                        program = g_strdup_printf ("dbus-run-session -- %s",
+                                                   self->selected_program);
                 }
         }
 


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