Blame SOURCES/0002-gdm-x-session-run-session-bus-on-non-seat0-seats.patch

8ee93f
From ea1de1173b46f76fe00b4f52b2b71ad16e35acc3 Mon Sep 17 00:00:00 2001
4e44f9
From: Ray Strode <rstrode@redhat.com>
4e44f9
Date: Wed, 5 Feb 2020 15:20:48 -0500
4e44f9
Subject: [PATCH 2/3] gdm-x-session: run session bus on non-seat0 seats
4e44f9
4e44f9
GNOME doesn't deal very well with multiple sessions
4e44f9
running on a multiple seats at the moment.
4e44f9
4e44f9
Until that's fixed, ensure sessions run on auxillary
4e44f9
seats get their own session bus.
4e44f9
---
4e44f9
 daemon/gdm-session.c | 11 ++++++++++-
4e44f9
 1 file changed, 10 insertions(+), 1 deletion(-)
4e44f9
4e44f9
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
4e44f9
index a65fa0f9..f13b54af 100644
4e44f9
--- a/daemon/gdm-session.c
4e44f9
+++ b/daemon/gdm-session.c
4e44f9
@@ -2864,119 +2864,128 @@ on_start_program_cb (GdmDBusWorker *worker,
4e44f9
         if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED) ||
4e44f9
             g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
4e44f9
                 return;
4e44f9
 
4e44f9
         self = conversation->session;
4e44f9
         service_name = conversation->service_name;
4e44f9
 
4e44f9
         if (worked) {
4e44f9
                 self->session_pid = pid;
4e44f9
                 self->session_conversation = conversation;
4e44f9
 
4e44f9
                 g_debug ("GdmSession: Emitting 'session-started' signal with pid '%d'", pid);
4e44f9
                 g_signal_emit (self, signals[SESSION_STARTED], 0, service_name, pid);
4e44f9
         } else {
4e44f9
                 gdm_session_stop_conversation (self, service_name);
4e44f9
 
4e44f9
                 g_debug ("GdmSession: Emitting 'session-start-failed' signal");
4e44f9
                 g_signal_emit (self, signals[SESSION_START_FAILED], 0, service_name, error->message);
4e44f9
         }
4e44f9
 }
4e44f9
 
4e44f9
 void
4e44f9
 gdm_session_start_session (GdmSession *self,
4e44f9
                            const char *service_name)
4e44f9
 {
4e44f9
         GdmSessionConversation *conversation;
4e44f9
         GdmSessionDisplayMode   display_mode;
4e44f9
         gboolean                is_x11 = TRUE;
4e44f9
         gboolean                run_launcher = FALSE;
4e44f9
         gboolean                allow_remote_connections = FALSE;
4e44f9
+        gboolean                run_separate_bus = FALSE;
4e44f9
         char                   *command;
4e44f9
         char                   *program;
4e44f9
         gboolean               register_session;
4e44f9
 
4e44f9
         g_return_if_fail (GDM_IS_SESSION (self));
4e44f9
         g_return_if_fail (self->session_conversation == NULL);
4e44f9
 
4e44f9
         conversation = find_conversation_by_name (self, service_name);
4e44f9
 
4e44f9
         if (conversation == NULL) {
4e44f9
                 g_warning ("GdmSession: Tried to start session of "
4e44f9
                            "nonexistent conversation %s", service_name);
4e44f9
                 return;
4e44f9
         }
4e44f9
 
4e44f9
         stop_all_other_conversations (self, conversation, FALSE);
4e44f9
 
4e44f9
         display_mode = gdm_session_get_display_mode (self);
4e44f9
 
4e44f9
 #ifdef ENABLE_WAYLAND_SUPPORT
4e44f9
         is_x11 = g_strcmp0 (self->session_type, "wayland") != 0;
4e44f9
 #endif
4e44f9
 
4e44f9
         if (display_mode == GDM_SESSION_DISPLAY_MODE_LOGIND_MANAGED ||
4e44f9
             display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
4e44f9
                 run_launcher = TRUE;
4e44f9
         }
4e44f9
 
4e44f9
         register_session = !gdm_session_session_registers (self);
4e44f9
 
4e44f9
+        if (g_strcmp0 (self->display_seat_id, "seat0") != 0 && !run_launcher) {
4e44f9
+                run_separate_bus = TRUE;
4e44f9
+        }
4e44f9
+
4e44f9
         if (self->selected_program == NULL) {
4e44f9
                 gboolean run_xsession_script;
4e44f9
 
4e44f9
                 command = get_session_command (self);
4e44f9
 
4e44f9
                 run_xsession_script = !gdm_session_bypasses_xsession (self);
4e44f9
 
4e44f9
                 if (self->display_is_local) {
4e44f9
                         gboolean disallow_tcp = TRUE;
4e44f9
                         gdm_settings_direct_get_boolean (GDM_KEY_DISALLOW_TCP, &disallow_tcp);
4e44f9
                         allow_remote_connections = !disallow_tcp;
4e44f9
                 } else {
4e44f9
                         allow_remote_connections = TRUE;
4e44f9
                 }
4e44f9
 
4e44f9
                 if (run_launcher) {
4e44f9
                         if (is_x11) {
4e44f9
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s%s %s\"%s\"",
4e44f9
                                                            register_session ? "--register-session " : "",
4e44f9
                                                            run_xsession_script? "--run-script " : "",
4e44f9
                                                            allow_remote_connections? "--allow-remote-connections " : "",
4e44f9
                                                            command);
4e44f9
                         } else {
4e44f9
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"%s\"",
4e44f9
                                                            register_session ? "--register-session " : "",
4e44f9
                                                            command);
4e44f9
                         }
4e44f9
                 } else if (run_xsession_script) {
4e44f9
-                        program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
4e44f9
+                        if (run_separate_bus) {
4e44f9
+                                program = g_strdup_printf ("dbus-run-session -- " GDMCONFDIR "/Xsession \"%s\"", command);
4e44f9
+                        } else {
4e44f9
+                                program = g_strdup_printf (GDMCONFDIR "/Xsession \"%s\"", command);
4e44f9
+                        }
4e44f9
                 } else {
4e44f9
                         program = g_strdup (command);
4e44f9
                 }
4e44f9
 
4e44f9
                 g_free (command);
4e44f9
         } else {
4e44f9
                 /* FIXME:
4e44f9
                  * Always use a separate DBus bus for each greeter session.
4e44f9
                  * Firstly, this means that if we run multiple greeter session
4e44f9
                  * (which we really should not do, but have to currently), then
4e44f9
                  * each one will get its own DBus session bus.
4e44f9
                  * But, we also explicitly do this for seat0, because that way
4e44f9
                  * it cannot make use of systemd to run the GNOME session. This
4e44f9
                  * prevents the session lookup logic from getting confused.
4e44f9
                  * This has a similar effect as passing --builtin to gnome-session.
4e44f9
                  *
4e44f9
                  * We really should not be doing this. But the fix is to use
4e44f9
                  * separate dynamically created users and that requires some
4e44f9
                  * major refactorings.
4e44f9
                  */
4e44f9
                 if (run_launcher) {
4e44f9
                         if (is_x11) {
4e44f9
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-x-session %s\"dbus-run-session -- %s\"",
4e44f9
                                                            register_session ? "--register-session " : "",
4e44f9
                                                            self->selected_program);
4e44f9
                         } else {
4e44f9
                                 program = g_strdup_printf (LIBEXECDIR "/gdm-wayland-session %s\"dbus-run-session -- %s\"",
4e44f9
                                                            register_session ? "--register-session " : "",
4e44f9
                                                            self->selected_program);
4e44f9
                         }
4e44f9
-- 
8ee93f
2.37.3
4e44f9