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

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