#11 Fix Xorg selection when SessionType is unspecified in accountsservice but session is specified
Merged 2 years ago by kalev. Opened 2 years ago by siosm.
rpms/ siosm/gdm rawhide  into  rawhide

@@ -0,0 +1,87 @@ 

+ From ef71c6330dde267f2fda9d58631bafac652fc8e3 Mon Sep 17 00:00:00 2001

+ From: Ray Strode <rstrode@redhat.com>

+ Date: Wed, 29 Sep 2021 11:03:41 -0400

+ Subject: [PATCH] daemon: Infer session type from desktop file if user has no

+  saved session type

+ 

+ The accountsservice user cache file can specify a session type

+ associated with the saved session.  This is optional though. If one

+ isn't specified GDM needs to figure out the session type based on the

+ list of preferred session types for the system and the session file

+ itself.

+ 

+ It was failing to do the latter, though.  This commit fixes that.

+ ---

+  daemon/gdm-session.c | 2 ++

+  1 file changed, 2 insertions(+)

+ 

+ diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c

+ index c1e2be00..4b709731 100644

+ --- a/daemon/gdm-session.c

+ +++ b/daemon/gdm-session.c

+ @@ -1009,60 +1009,62 @@ worker_on_saved_language_name_read (GdmDBusWorker          *worker,

+                  }

+          }

+  }

+  

+  static void

+  worker_on_saved_session_name_read (GdmDBusWorker          *worker,

+                                     const char             *session_name,

+                                     GdmSessionConversation *conversation)

+  {

+          GdmSession *self = conversation->session;

+  

+          if (! get_session_command_for_name (self, session_name, self->saved_session_type, NULL)) {

+                  /* ignore sessions that don't exist */

+                  g_debug ("GdmSession: not using invalid .dmrc session: %s", session_name);

+                  g_free (self->saved_session);

+                  self->saved_session = NULL;

+                  update_session_type (self);

+          } else {

+                  if (strcmp (session_name,

+                              get_default_session_name (self)) != 0) {

+                          g_free (self->saved_session);

+                          self->saved_session = g_strdup (session_name);

+  

+                          if (self->greeter_interface != NULL) {

+                                  gdm_dbus_greeter_emit_default_session_name_changed (self->greeter_interface,

+                                                                                      session_name);

+                          }

+                  }

+                  if (self->saved_session_type != NULL)

+                          set_session_type (self, self->saved_session_type);

+ +                else

+ +                        update_session_type (self);

+          }

+  

+  }

+  

+  static void

+  worker_on_saved_session_type_read (GdmDBusWorker          *worker,

+                                     const char             *session_type,

+                                     GdmSessionConversation *conversation)

+  {

+          GdmSession *self = conversation->session;

+  

+          g_free (self->saved_session_type);

+          self->saved_session_type = g_strdup (session_type);

+  }

+  

+  static GdmSessionConversation *

+  find_conversation_by_pid (GdmSession *self,

+                            GPid        pid)

+  {

+          GHashTableIter iter;

+          gpointer key, value;

+  

+          g_hash_table_iter_init (&iter, self->conversations);

+          while (g_hash_table_iter_next (&iter, &key, &value)) {

+                  GdmSessionConversation *conversation;

+  

+                  conversation = (GdmSessionConversation *) value;

+  

+                  if (conversation->worker_pid == pid) {

+                          return conversation;

+ -- 

+ 2.31.1

+ 

file modified
+9 -1
@@ -11,7 +11,7 @@ 

  Name: gdm

  Epoch: 1

  Version: 41.0

- Release: 2%{?dist}

+ Release: 3%{?dist}

  Summary: The GNOME Display Manager

  

  License: GPLv2+
@@ -24,6 +24,9 @@ 

  

  Source6: gdm.sysusers

  

+ # https://bugzilla.redhat.com/show_bug.cgi?id=2007742

+ Patch10001: 0001-daemon-Infer-session-type-from-desktop-file-if-user-.patch

+ 

  # Downstream patches

  Patch80001: 0001-Honor-initial-setup-being-disabled-by-distro-install.patch

  Patch90001: 0001-data-add-system-dconf-databases-to-gdm-profile.patch
@@ -300,6 +303,11 @@ 

  %{_libdir}/pkgconfig/gdm-pam-extensions.pc

  

  %changelog

+ * Tue Nov 16 2021 Ray Strode <rstrode@redhat.com> - 1:41.0-3

+ - Fix Xorg selection when SessionType is unspecified in accountsservice

+   but session is specified.

+   Resolves: #2007742

+ 

  * Fri Oct 15 2021 Timothée Ravier <tim@siosm.fr> - 1:41.0-2

  - Use systemd sysusers config to create user and group

  

Made to sync rawhide and F35.

Pull-Request has been merged by kalev

2 years ago