Bug#876527: stretch-pu: package gdm3/3.22.3-3
Laurent Bigonville
bigon at debian.org
Sat Sep 23 11:04:23 UTC 2017
Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian.org at packages.debian.org
Usertags: pu
Hi,
XDMCP support in gdm 3.22 is currently completely broken (see: #873199)
I've backported some patches from the later releases and from git master
fix this. The majority of the patches are already included in sid/buster
version, the other ones will be included in the 2nd of Octobre point
release.
I've tested this locally with one client (both direct and indirect
connections) and it's working as expected.
Regards,
Laurent Bigonville
-- System Information:
Debian Release: buster/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.13.0-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_BE.UTF-8, LC_CTYPE=fr_BE.UTF-8 (charmap=UTF-8), LANGUAGE=fr_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
diff -Nru gdm3-3.22.3/debian/changelog gdm3-3.22.3/debian/changelog
--- gdm3-3.22.3/debian/changelog 2017-06-06 20:17:04.000000000 +0200
+++ gdm3-3.22.3/debian/changelog 2017-09-23 11:56:40.000000000 +0200
@@ -1,3 +1,10 @@
+gdm3 (3.22.3-3+deb9u1) stretch; urgency=medium
+
+ * Backports a bunch of patches to fix XDMCP support including a potential
+ cracher (Closes: #873199, #814989)
+
+ -- Laurent Bigonville <bigon at debian.org> Sat, 23 Sep 2017 11:56:40 +0200
+
gdm3 (3.22.3-3) unstable; urgency=medium
* libgdm1: add breaks/replaces on good old gdm. Who knows how many users
diff -Nru gdm3-3.22.3/debian/patches/chooser-filter-out-duplicate-hostnames.patch gdm3-3.22.3/debian/patches/chooser-filter-out-duplicate-hostnames.patch
--- gdm3-3.22.3/debian/patches/chooser-filter-out-duplicate-hostnames.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/chooser-filter-out-duplicate-hostnames.patch 2017-09-23 11:56:40.000000000 +0200
@@ -0,0 +1,72 @@
+From 2738cc21830eee9468c83608504d6bf719f8ac03 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 15:40:21 -0400
+Subject: [PATCH] chooser: filter out duplicate hostnames
+
+One host may report itself on multiple interfaces.
+GDM only supports based on hostname not interface,
+so that leads duplicate entries in the list.
+
+This commit filters out the dupes.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ chooser/gdm-host-chooser-widget.c | 34 +++++++++++++++++++++++++++++++++-
+ 1 file changed, 33 insertions(+), 1 deletion(-)
+
+diff --git a/chooser/gdm-host-chooser-widget.c b/chooser/gdm-host-chooser-widget.c
+index f8aabf3e..e2507900 100644
+--- a/chooser/gdm-host-chooser-widget.c
++++ b/chooser/gdm-host-chooser-widget.c
+@@ -119,6 +119,33 @@ chooser_host_remove (GdmHostChooserWidget *widget,
+ }
+ #endif
+
++static gboolean
++address_hostnames_equal (GdmAddress *address,
++ GdmAddress *other_address)
++{
++ char *hostname, *other_hostname;
++ gboolean are_equal;
++
++ if (gdm_address_equal (address, other_address)) {
++ return TRUE;
++ }
++
++ if (!gdm_address_get_hostname (address, &hostname)) {
++ gdm_address_get_numeric_info (address, &hostname, NULL);
++ }
++
++ if (!gdm_address_get_hostname (other_address, &other_hostname)) {
++ gdm_address_get_numeric_info (other_address, &other_hostname, NULL);
++ }
++
++ are_equal = g_strcmp0 (hostname, other_hostname) == 0;
++
++ g_free (hostname);
++ g_free (other_hostname);
++
++ return are_equal;
++}
++
+ static GdmChooserHost *
+ find_known_host (GdmHostChooserWidget *widget,
+ GdmAddress *address)
+@@ -127,8 +154,13 @@ find_known_host (GdmHostChooserWidget *widget,
+ GdmChooserHost *host;
+
+ for (li = widget->priv->chooser_hosts; li != NULL; li = li->next) {
++ GdmAddress *other_address;
++
+ host = li->data;
+- if (gdm_address_equal (gdm_chooser_host_get_address (host), address)) {
++
++ other_address = gdm_chooser_host_get_address (host);
++
++ if (address_hostnames_equal (address, other_address)) {
+ goto out;
+ }
+ }
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/chooser-fix-duplicate-entry-in-the-list.patch gdm3-3.22.3/debian/patches/chooser-fix-duplicate-entry-in-the-list.patch
--- gdm3-3.22.3/debian/patches/chooser-fix-duplicate-entry-in-the-list.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/chooser-fix-duplicate-entry-in-the-list.patch 2017-09-23 11:56:40.000000000 +0200
@@ -0,0 +1,27 @@
+From b08bbb52f422b33768cef9351bb860a2fe1ae91d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 15:11:03 -0400
+Subject: [PATCH] chooser: fix duplicate entry in the list
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ chooser/gdm-host-chooser-widget.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chooser/gdm-host-chooser-widget.c b/chooser/gdm-host-chooser-widget.c
+index f9200aa0..b8924618 100644
+--- a/chooser/gdm-host-chooser-widget.c
++++ b/chooser/gdm-host-chooser-widget.c
+@@ -273,8 +273,8 @@ decode_packet (GIOChannel *source,
+ /* server changed it's mind */
+ if (header.opcode == WILLING
+ && ! gdm_chooser_host_get_willing (chooser_host)) {
+- g_object_set (chooser_host, "willing", TRUE, NULL);
+ browser_add_host (widget, chooser_host);
++ g_object_set (chooser_host, "willing", TRUE, NULL);
+ }
+ /* FIXME: handle unwilling? */
+ }
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/chooser-make-host-list-fill-the-dialog.patch gdm3-3.22.3/debian/patches/chooser-make-host-list-fill-the-dialog.patch
--- gdm3-3.22.3/debian/patches/chooser-make-host-list-fill-the-dialog.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/chooser-make-host-list-fill-the-dialog.patch 2017-09-23 11:56:40.000000000 +0200
@@ -0,0 +1,26 @@
+From b47e8207b932d914d49d8445abb30b9056a868ed Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 15:21:45 -0400
+Subject: [PATCH] chooser: make host list fill the dialog
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ chooser/gdm-host-chooser-dialog.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chooser/gdm-host-chooser-dialog.c b/chooser/gdm-host-chooser-dialog.c
+index 02169502..b9581a34 100644
+--- a/chooser/gdm-host-chooser-dialog.c
++++ b/chooser/gdm-host-chooser-dialog.c
+@@ -133,7 +133,7 @@ gdm_host_chooser_dialog_constructor (GType type,
+
+
+ dialog->priv->chooser_widget = gdm_host_chooser_widget_new (dialog->priv->kind_mask);
+- gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), dialog->priv->chooser_widget);
++ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), dialog->priv->chooser_widget, TRUE, TRUE, 0);
+ gtk_container_set_border_width (GTK_CONTAINER (dialog->priv->chooser_widget), 5);
+
+ gtk_dialog_add_buttons (GTK_DIALOG (dialog),
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/chooser-switch-to-browse-selection-mode.patch gdm3-3.22.3/debian/patches/chooser-switch-to-browse-selection-mode.patch
--- gdm3-3.22.3/debian/patches/chooser-switch-to-browse-selection-mode.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/chooser-switch-to-browse-selection-mode.patch 2017-09-23 11:56:40.000000000 +0200
@@ -0,0 +1,50 @@
+From cde9a55b0eebd44a292a7fd91dee34c5a23f66eb Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 15:22:06 -0400
+Subject: [PATCH] chooser: switch to browse selection mode
+
+The chooser is a host browser after all. It makes not sense to
+have an unselected item.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ chooser/gdm-host-chooser-widget.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/chooser/gdm-host-chooser-widget.c b/chooser/gdm-host-chooser-widget.c
+index b8924618..f8aabf3e 100644
+--- a/chooser/gdm-host-chooser-widget.c
++++ b/chooser/gdm-host-chooser-widget.c
+@@ -151,6 +151,8 @@ browser_add_host (GdmHostChooserWidget *widget,
+ GtkTreeIter iter;
+ gboolean res;
+
++ GtkTreeSelection *selection;
++
+ g_assert (host != NULL);
+
+ if (! gdm_chooser_host_get_willing (host)) {
+@@ -180,6 +182,11 @@ browser_add_host (GdmHostChooserWidget *widget,
+ -1);
+ g_free (label);
+
++ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget->priv->treeview));
++ if (!gtk_tree_selection_get_selected (selection, NULL, NULL)) {
++ gtk_tree_selection_select_iter (selection, &iter);
++ }
++
+ }
+
+ static gboolean
+@@ -804,7 +811,7 @@ gdm_host_chooser_widget_init (GdmHostChooserWidget *widget)
+ gtk_container_add (GTK_CONTAINER (scrolled), widget->priv->treeview);
+
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget->priv->treeview));
+- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
++ gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
+ g_signal_connect (selection, "changed",
+ G_CALLBACK (on_host_selected),
+ widget);
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/gdm-sessions-force-a-session-bus-for-non-seat0-sessi.patch gdm3-3.22.3/debian/patches/gdm-sessions-force-a-session-bus-for-non-seat0-sessi.patch
--- gdm3-3.22.3/debian/patches/gdm-sessions-force-a-session-bus-for-non-seat0-sessi.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/gdm-sessions-force-a-session-bus-for-non-seat0-sessi.patch 2017-09-23 11:09:06.000000000 +0200
@@ -0,0 +1,43 @@
+From e126fe383ca516afecc888ea884b6ab01032df20 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Wed, 20 Sep 2017 09:47:53 -0400
+Subject: [PATCH] gdm-sessions: force a session bus for non-seat0 session
+
+Eventually, our software should become "multi-seat aware",
+where it takes into account multiple seats at a time
+for the user (even if it's just putting up a dialog saying
+"user is busy" on all but one seat).
+
+We're not there yet. And user bus currently breaks XDMCP
+(which should really spawn session with its own separate user,
+ but again, we're not there yet).
+
+This commit changes GDM to start a session bus for all non-seat0
+displays, as a near-term workaround.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=787943
+---
+ daemon/gdm-session.c | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
+index e69291fb..d2dabd9e 100644
+--- a/daemon/gdm-session.c
++++ b/daemon/gdm-session.c
+@@ -2790,7 +2790,12 @@ gdm_session_start_session (GdmSession *self,
+ self->priv->selected_program);
+ }
+ } else {
+- program = g_strdup (self->priv->selected_program);
++ if (g_strcmp0 (self->priv->display_seat_id, "seat0") != 0) {
++ program = g_strdup_printf ("dbus-run-session -- %s",
++ self->priv->selected_program);
++ } else {
++ program = g_strdup (self->priv->selected_program);
++ }
+ }
+ }
+
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/launch-environment-fix-crasher-when-session-mode-isn.patch gdm3-3.22.3/debian/patches/launch-environment-fix-crasher-when-session-mode-isn.patch
--- gdm3-3.22.3/debian/patches/launch-environment-fix-crasher-when-session-mode-isn.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/launch-environment-fix-crasher-when-session-mode-isn.patch 2017-09-23 11:56:32.000000000 +0200
@@ -0,0 +1,41 @@
+From 50b0751c3cf9bb56cbe4223e5884a01ce58be5e3 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Mon, 27 Mar 2017 16:56:29 -0400
+Subject: [PATCH] launch-environment: fix crasher when session-mode isn't set
+
+This commit fixes a crasher when starting the indirect chooser.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780618
+---
+ daemon/gdm-launch-environment.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c
+index a30276b4..4372ac29 100644
+--- a/daemon/gdm-launch-environment.c
++++ b/daemon/gdm-launch-environment.c
+@@ -155,14 +155,15 @@ build_launch_environment (GdmLaunchEnvironment *launch_environment,
+ if (launch_environment->priv->x11_authority_file != NULL)
+ g_hash_table_insert (hash, g_strdup ("XAUTHORITY"), g_strdup (launch_environment->priv->x11_authority_file));
+
+- if (launch_environment->priv->session_mode != NULL)
++ if (launch_environment->priv->session_mode != NULL) {
+ g_hash_table_insert (hash, g_strdup ("GNOME_SHELL_SESSION_MODE"), g_strdup (launch_environment->priv->session_mode));
+
+- /* Inital setup needs gvfs for fetching remote avatars. */
+- if (strcmp (launch_environment->priv->session_mode, INITIAL_SETUP_SESSION_MODE) != 0) {
+- g_hash_table_insert (hash, g_strdup ("GVFS_DISABLE_FUSE"), g_strdup ("1"));
+- g_hash_table_insert (hash, g_strdup ("GIO_USE_VFS"), g_strdup ("local"));
+- g_hash_table_insert (hash, g_strdup ("GVFS_REMOTE_VOLUME_MONITOR_IGNORE"), g_strdup ("1"));
++ /* Inital setup needs gvfs for fetching remote avatars. */
++ if (strcmp (launch_environment->priv->session_mode, INITIAL_SETUP_SESSION_MODE) != 0) {
++ g_hash_table_insert (hash, g_strdup ("GVFS_DISABLE_FUSE"), g_strdup ("1"));
++ g_hash_table_insert (hash, g_strdup ("GIO_USE_VFS"), g_strdup ("local"));
++ g_hash_table_insert (hash, g_strdup ("GVFS_REMOTE_VOLUME_MONITOR_IGNORE"), g_strdup ("1"));
++ }
+ }
+
+ g_hash_table_insert (hash, g_strdup ("LOGNAME"), g_strdup (launch_environment->priv->user_name));
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/launch-environment-implement-hostname-selected-signa.patch gdm3-3.22.3/debian/patches/launch-environment-implement-hostname-selected-signa.patch
--- gdm3-3.22.3/debian/patches/launch-environment-implement-hostname-selected-signa.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/launch-environment-implement-hostname-selected-signa.patch 2017-09-23 11:56:40.000000000 +0200
@@ -0,0 +1,93 @@
+From 92887f14c661c3530e0d9d6e1ac04d04130fbecf Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 15:01:06 -0400
+Subject: [PATCH] launch-environment: implement hostname-selected signal
+
+We're connecting to a signal that isn't implemented. This
+commit adds the implementation.
+
+A slightly better fix might be to cut out some of the layers,
+of middle men passing around hostname-selected, but for now this
+is fine.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ daemon/gdm-launch-environment.c | 27 +++++++++++++++++++++++++++
+ daemon/gdm-launch-environment.h | 2 ++
+ 2 files changed, 29 insertions(+)
+
+diff --git a/daemon/gdm-launch-environment.c b/daemon/gdm-launch-environment.c
+index 4372ac29..a7ae6728 100644
+--- a/daemon/gdm-launch-environment.c
++++ b/daemon/gdm-launch-environment.c
+@@ -103,6 +103,7 @@ enum {
+ STOPPED,
+ EXITED,
+ DIED,
++ HOSTNAME_SELECTED,
+ LAST_SIGNAL
+ };
+
+@@ -263,6 +264,15 @@ on_session_died (GdmSession *session,
+ g_signal_emit (G_OBJECT (launch_environment), signals [DIED], 0, signal_number);
+ }
+
++static void
++on_hostname_selected (GdmSession *session,
++ const char *hostname,
++ GdmLaunchEnvironment *launch_environment)
++{
++ g_debug ("GdmSession: hostname selected: %s", hostname);
++ g_signal_emit (launch_environment, signals [HOSTNAME_SELECTED], 0, hostname);
++}
++
+ static void
+ on_conversation_started (GdmSession *session,
+ const char *service_name,
+@@ -409,6 +419,11 @@ gdm_launch_environment_start (GdmLaunchEnvironment *launch_environment)
+ G_CALLBACK (on_session_died),
+ launch_environment,
+ 0);
++ g_signal_connect_object (launch_environment->priv->session,
++ "hostname-selected",
++ G_CALLBACK (on_hostname_selected),
++ launch_environment,
++ 0);
+
+ gdm_session_start_conversation (launch_environment->priv->session, "gdm-launch-environment");
+ gdm_session_select_program (launch_environment->priv->session, launch_environment->priv->command);
+@@ -807,6 +822,18 @@ gdm_launch_environment_class_init (GdmLaunchEnvironmentClass *klass)
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_INT);
++
++ signals [HOSTNAME_SELECTED] =
++ g_signal_new ("hostname-selected",
++ G_OBJECT_CLASS_TYPE (object_class),
++ G_SIGNAL_RUN_FIRST,
++ G_STRUCT_OFFSET (GdmLaunchEnvironmentClass, hostname_selected),
++ NULL,
++ NULL,
++ g_cclosure_marshal_VOID__STRING,
++ G_TYPE_NONE,
++ 1,
++ G_TYPE_STRING);
+ }
+
+ static void
+diff --git a/daemon/gdm-launch-environment.h b/daemon/gdm-launch-environment.h
+index 3fd875c2..c2a09d1c 100644
+--- a/daemon/gdm-launch-environment.h
++++ b/daemon/gdm-launch-environment.h
+@@ -59,6 +59,8 @@ typedef struct
+ int exit_code);
+ void (* died) (GdmLaunchEnvironment *launch_environment,
+ int signal_number);
++ void (* hostname_selected) (GdmLaunchEnvironment *launch_environment,
++ const char *hostname);
+ } GdmLaunchEnvironmentClass;
+
+ GType gdm_launch_environment_get_type (void);
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/manager-don-t-allow-autologin-from-transient-display.patch gdm3-3.22.3/debian/patches/manager-don-t-allow-autologin-from-transient-display.patch
--- gdm3-3.22.3/debian/patches/manager-don-t-allow-autologin-from-transient-display.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/manager-don-t-allow-autologin-from-transient-display.patch 2017-09-23 11:56:40.000000000 +0200
@@ -0,0 +1,43 @@
+From b3c4f0265159f29b26c06ca164f92cc57466fd8d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Mon, 11 Sep 2017 16:44:15 -0400
+Subject: [PATCH] manager: don't allow autologin from transient displays
+
+In theory, we're only only supposed to allow autologin
+the first time a session is run, but we only count a
+session run, once it's finished. This means that if a
+user creates a transient session to user switch, before
+they've logged out the first time at boot up, that
+transient session will begin autologin as well (which
+actually gets treated as an auto unlock).
+
+This commit makes sure autologin is only ever run on
+the initial display.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=783779
+---
+ daemon/gdm-manager.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
+index 8afa6e16..f93d4402 100644
+--- a/daemon/gdm-manager.c
++++ b/daemon/gdm-manager.c
+@@ -1460,10 +1460,13 @@ set_up_session (GdmManager *manager,
+ ActUserManager *user_manager;
+ ActUser *user;
+ gboolean loaded;
++ gboolean is_initial_display = FALSE;
+ gboolean autologin_enabled = FALSE;
+ char *username = NULL;
+
+- if (!manager->priv->ran_once && display_is_on_seat0 (display))
++ g_object_get (G_OBJECT (display), "is-initial", &is_initial_display, NULL);
++
++ if (!manager->priv->ran_once && is_initial_display)
+ autologin_enabled = get_automatic_login_details (manager, &username);
+
+ if (!autologin_enabled) {
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/manager-drop-some-erroneous-code.patch gdm3-3.22.3/debian/patches/manager-drop-some-erroneous-code.patch
--- gdm3-3.22.3/debian/patches/manager-drop-some-erroneous-code.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/manager-drop-some-erroneous-code.patch 2017-09-23 11:09:06.000000000 +0200
@@ -0,0 +1,46 @@
+From 7524d5ffd6c3176d4604389101dc48babcd2cd5d Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 14:56:46 -0400
+Subject: [PATCH] manager: drop some erroneous code
+
+This is commit 82296a3350b64d0ed5ae3b9f6983466c60dd8a53 all over
+again. The code snuck back in during a refactor !
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ daemon/gdm-manager.c | 18 ------------------
+ 1 file changed, 18 deletions(-)
+
+diff --git a/daemon/gdm-manager.c b/daemon/gdm-manager.c
+index 35a7a0fe..afd15d09 100644
+--- a/daemon/gdm-manager.c
++++ b/daemon/gdm-manager.c
+@@ -1875,25 +1875,7 @@ on_session_client_disconnected (GdmSession *session,
+ GPid pid_of_client,
+ GdmManager *manager)
+ {
+- GdmDisplay *display;
+- gboolean display_is_local;
+-
+ g_debug ("GdmManager: client disconnected");
+-
+- display = get_display_for_user_session (session);
+-
+- if (display == NULL) {
+- return;
+- }
+-
+- g_object_get (G_OBJECT (display),
+- "is-local", &display_is_local,
+- NULL);
+-
+- if ( ! display_is_local && gdm_session_is_running (session)) {
+- gdm_display_unmanage (display);
+- gdm_display_finish (display);
+- }
+ }
+
+ typedef struct
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/manager-fix-up-support-for-chooser.patch gdm3-3.22.3/debian/patches/manager-fix-up-support-for-chooser.patch
--- gdm3-3.22.3/debian/patches/manager-fix-up-support-for-chooser.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/manager-fix-up-support-for-chooser.patch 2017-09-23 11:56:40.000000000 +0200
@@ -0,0 +1,211 @@
+From 9b8e351e8672d56f085f7cb230f58427a5290f2f Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 14:54:44 -0400
+Subject: [PATCH] manager: fix up support for chooser
+
+We were missing some chunks of code to handle dealing with
+the chooser.
+
+This commit adds in the necessary bits to start the chooser,
+and deal with the choice.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ daemon/gdm-manager.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++---
+ 1 file changed, 133 insertions(+), 8 deletions(-)
+
+--- a/daemon/gdm-manager.c
++++ b/daemon/gdm-manager.c
+@@ -34,6 +34,8 @@
+ #include <glib/gstdio.h>
+ #include <glib-object.h>
+
++#include <act/act-user-manager.h>
++
+ #include <systemd/sd-login.h>
+
+ #include "gdm-common.h"
+@@ -43,6 +45,7 @@
+ #include "gdm-manager-glue.h"
+ #include "gdm-display-store.h"
+ #include "gdm-display-factory.h"
++#include "gdm-launch-environment.h"
+ #include "gdm-local-display.h"
+ #include "gdm-local-display-factory.h"
+ #include "gdm-session.h"
+@@ -50,6 +53,7 @@
+ #include "gdm-settings-direct.h"
+ #include "gdm-settings-keys.h"
+ #include "gdm-xdmcp-display-factory.h"
++#include "gdm-xdmcp-chooser-display.h"
+
+ #define GDM_MANAGER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GDM_TYPE_MANAGER, GdmManagerPrivate))
+
+@@ -818,7 +822,7 @@ gdm_manager_handle_open_session (GdmDBus
+ const char *sender;
+ GDBusConnection *connection;
+ GdmDisplay *display = NULL;
+- GdmSession *session;
++ GdmSession *session = NULL;
+ const char *address;
+ GPid pid = 0;
+ uid_t uid = (uid_t) -1;
+@@ -839,14 +843,32 @@ gdm_manager_handle_open_session (GdmDBus
+ return TRUE;
+ }
+
+- session = get_embryonic_user_session_for_display (display);
++ if (GDM_IS_XDMCP_CHOOSER_DISPLAY (display)) {
++ GdmLaunchEnvironment *launch_environment;
+
+- if (gdm_session_is_running (session)) {
+- g_dbus_method_invocation_return_error_literal (invocation,
+- G_DBUS_ERROR,
+- G_DBUS_ERROR_ACCESS_DENIED,
+- _("Can only be called before user is logged in"));
+- return TRUE;
++ g_object_get (display, "launch-environment", &launch_environment, NULL);
++
++ if (launch_environment != NULL) {
++ session = gdm_launch_environment_get_session (launch_environment);
++ }
++
++ if (session == NULL) {
++ g_dbus_method_invocation_return_error_literal (invocation,
++ G_DBUS_ERROR,
++ G_DBUS_ERROR_ACCESS_DENIED,
++ _("Chooser session unavailable"));
++ return TRUE;
++ }
++ } else {
++ session = get_embryonic_user_session_for_display (display);
++
++ if (gdm_session_is_running (session)) {
++ g_dbus_method_invocation_return_error_literal (invocation,
++ G_DBUS_ERROR,
++ G_DBUS_ERROR_ACCESS_DENIED,
++ _("Can only be called before user is logged in"));
++ return TRUE;
++ }
+ }
+
+ allowed_user = gdm_session_get_allowed_user (session);
+@@ -1353,6 +1375,26 @@ set_up_automatic_login_session (GdmManag
+ }
+
+ static void
++set_up_chooser_session (GdmManager *manager,
++ GdmDisplay *display)
++{
++ const char *allowed_user;
++ struct passwd *passwd_entry;
++
++ allowed_user = get_username_for_greeter_display (manager, display);
++
++ if (!gdm_get_pwent_for_name (allowed_user, &passwd_entry)) {
++ g_warning ("GdmManager: couldn't look up username %s",
++ allowed_user);
++ gdm_display_unmanage (display);
++ gdm_display_finish (display);
++ return;
++ }
++
++ gdm_display_start_greeter_session (display);
++}
++
++static void
+ set_up_greeter_session (GdmManager *manager,
+ GdmDisplay *display)
+ {
+@@ -1374,6 +1416,91 @@ set_up_greeter_session (GdmManager *mana
+ }
+
+ static void
++set_up_automatic_login_session_if_user_exists (GdmManager *manager,
++ GdmDisplay *display,
++ ActUser *user)
++{
++ if (act_user_is_nonexistent (user))
++ set_up_greeter_session (manager, display);
++ else
++ set_up_automatic_login_session (manager, display);
++}
++
++typedef struct {
++ GdmManager *manager;
++ GdmDisplay *display;
++ char *username;
++} UsernameLookupOperation;
++
++static void
++destroy_username_lookup_operation (UsernameLookupOperation *operation)
++{
++ g_object_unref (operation->manager);
++ g_object_unref (operation->display);
++ g_free (operation->username);
++ g_free (operation);
++}
++
++static void
++on_user_is_loaded_changed (ActUser *user,
++ GParamSpec *pspec,
++ UsernameLookupOperation *operation)
++{
++ if (act_user_is_loaded (user)) {
++ set_up_automatic_login_session_if_user_exists (operation->manager, operation->display, user);
++ g_signal_handlers_disconnect_by_func (G_OBJECT (user),
++ G_CALLBACK (on_user_is_loaded_changed),
++ operation);
++ destroy_username_lookup_operation (operation);
++ }
++}
++
++static void
++set_up_session (GdmManager *manager,
++ GdmDisplay *display)
++{
++ ActUserManager *user_manager;
++ ActUser *user;
++ gboolean loaded;
++ gboolean autologin_enabled = FALSE;
++ char *username = NULL;
++
++ if (!manager->priv->ran_once && display_is_on_seat0 (display))
++ autologin_enabled = get_automatic_login_details (manager, &username);
++
++ if (!autologin_enabled) {
++ if (GDM_IS_XDMCP_CHOOSER_DISPLAY (display)) {
++ set_up_chooser_session (manager, display);
++ } else {
++ set_up_greeter_session (manager, display);
++ }
++ g_free (username);
++ return;
++ }
++
++ /* Check whether the user really exists before committing to autologin. */
++ user_manager = act_user_manager_get_default ();
++ user = act_user_manager_get_user (user_manager, username);
++ g_object_get (user_manager, "is-loaded", &loaded, NULL);
++
++ if (loaded) {
++ set_up_automatic_login_session_if_user_exists (manager, display, user);
++ } else {
++ UsernameLookupOperation *operation;
++
++ operation = g_new (UsernameLookupOperation, 1);
++ operation->manager = g_object_ref (manager);
++ operation->display = g_object_ref (display);
++ operation->username = username;
++
++ g_signal_connect (user,
++ "notify::is-loaded",
++ G_CALLBACK (on_user_is_loaded_changed),
++ operation);
++ }
++}
++
++static void
+ greeter_display_started (GdmManager *manager,
+ GdmDisplay *display)
+ {
diff -Nru gdm3-3.22.3/debian/patches/series gdm3-3.22.3/debian/patches/series
--- gdm3-3.22.3/debian/patches/series 2017-05-09 18:32:34.000000000 +0200
+++ gdm3-3.22.3/debian/patches/series 2017-09-23 11:56:40.000000000 +0200
@@ -7,3 +7,18 @@
Hack-D-Bus-messages-from-Debian-8-libgdm-to-work-wit.patch
pam_gdm-allow-setting-pam-module-dir-at-configure-ti.patch
stop-greeter-explicitly-when-finishing-display.patch
+manager-drop-some-erroneous-code.patch
+xdmcp-display-don-t-set-MANAGED-until-we-ve-connecte.patch
+xdmcp-display-factory-fix-signal-prototype.patch
+xdmcp-display-factory-explicitly-stop-greeter-sessio.patch
+session-worker-only-jump-to-VT-on-seat0.patch
+gdm-sessions-force-a-session-bus-for-non-seat0-sessi.patch
+xdmcp-display-factory-more-signal-prototype-fixing.patch
+launch-environment-fix-crasher-when-session-mode-isn.patch
+launch-environment-implement-hostname-selected-signa.patch
+manager-fix-up-support-for-chooser.patch
+chooser-fix-duplicate-entry-in-the-list.patch
+chooser-make-host-list-fill-the-dialog.patch
+chooser-switch-to-browse-selection-mode.patch
+chooser-filter-out-duplicate-hostnames.patch
+manager-don-t-allow-autologin-from-transient-display.patch
diff -Nru gdm3-3.22.3/debian/patches/session-worker-only-jump-to-VT-on-seat0.patch gdm3-3.22.3/debian/patches/session-worker-only-jump-to-VT-on-seat0.patch
--- gdm3-3.22.3/debian/patches/session-worker-only-jump-to-VT-on-seat0.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/session-worker-only-jump-to-VT-on-seat0.patch 2017-09-23 11:09:06.000000000 +0200
@@ -0,0 +1,46 @@
+From 432d7ebeafeb541b33bec016e51ef2f18e5a0b69 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Wed, 20 Sep 2017 12:02:38 -0400
+Subject: [PATCH] session-worker: only jump to VT on seat0
+
+seat0 is the only seat that supports VTs, so don't ever try to
+change VTs if not on seat0.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=787943
+---
+ daemon/gdm-session-worker.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
+index d97b02b5..c85baa84 100644
+--- a/daemon/gdm-session-worker.c
++++ b/daemon/gdm-session-worker.c
+@@ -909,8 +909,10 @@ gdm_session_worker_uninitialize_pam (GdmSessionWorker *worker,
+
+ gdm_session_worker_stop_auditor (worker);
+
+- if (worker->priv->login_vt != worker->priv->session_vt) {
+- jump_to_vt (worker, worker->priv->login_vt);
++ if (g_strcmp0 (worker->priv->display_seat_id, "seat0") == 0) {
++ if (worker->priv->login_vt != worker->priv->session_vt) {
++ jump_to_vt (worker, worker->priv->login_vt);
++ }
+ }
+
+ worker->priv->login_vt = 0;
+@@ -1852,8 +1854,10 @@ gdm_session_worker_start_session (GdmSessionWorker *worker,
+ /* If we're in new vt mode, jump to the new vt now. There's no need to jump for
+ * the other two modes: in the logind case, the session will activate itself when
+ * ready, and in the reuse server case, we're already on the correct VT. */
+- if (worker->priv->display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
+- jump_to_vt (worker, worker->priv->session_vt);
++ if (g_strcmp0 (worker->priv->display_seat_id, "seat0") == 0) {
++ if (worker->priv->display_mode == GDM_SESSION_DISPLAY_MODE_NEW_VT) {
++ jump_to_vt (worker, worker->priv->session_vt);
++ }
+ }
+
+ if (!worker->priv->is_program_session && !run_script (worker, GDMCONFDIR "/PostLogin")) {
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/xdmcp-display-don-t-set-MANAGED-until-we-ve-connecte.patch gdm3-3.22.3/debian/patches/xdmcp-display-don-t-set-MANAGED-until-we-ve-connecte.patch
--- gdm3-3.22.3/debian/patches/xdmcp-display-don-t-set-MANAGED-until-we-ve-connecte.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/xdmcp-display-don-t-set-MANAGED-until-we-ve-connecte.patch 2017-09-23 11:09:06.000000000 +0200
@@ -0,0 +1,41 @@
+From 4d9056cafd07a769874e1e0a0b4cc1f098343c56 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 14:52:23 -0400
+Subject: [PATCH] xdmcp-display: don't set MANAGED until we've connected
+
+We don't want to start the greeter session until we've
+successfully connected to the display ourselves!
+
+This prevents a race where session processes may inadvertently
+ get the initial connection to the display server, causing
+premature resets.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ daemon/gdm-xdmcp-display.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/daemon/gdm-xdmcp-display.c b/daemon/gdm-xdmcp-display.c
+index c9f9c3d2..630844f2 100644
+--- a/daemon/gdm-xdmcp-display.c
++++ b/daemon/gdm-xdmcp-display.c
+@@ -193,6 +193,7 @@ idle_connect_to_display (GdmXdmcpDisplay *self)
+
+ res = gdm_display_connect (GDM_DISPLAY (self));
+ if (res) {
++ g_object_set (G_OBJECT (self), "status", GDM_DISPLAY_MANAGED, NULL);
+ } else {
+ if (self->priv->connection_attempts >= MAX_CONNECT_ATTEMPTS) {
+ g_warning ("Unable to connect to display after %d tries - bailing out", self->priv->connection_attempts);
+@@ -211,8 +212,6 @@ gdm_xdmcp_display_manage (GdmDisplay *display)
+ GdmXdmcpDisplay *self = GDM_XDMCP_DISPLAY (display);
+
+ g_timeout_add (500, (GSourceFunc)idle_connect_to_display, self);
+-
+- g_object_set (G_OBJECT (self), "status", GDM_DISPLAY_MANAGED, NULL);
+ }
+
+ static void
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/xdmcp-display-factory-explicitly-stop-greeter-sessio.patch gdm3-3.22.3/debian/patches/xdmcp-display-factory-explicitly-stop-greeter-sessio.patch
--- gdm3-3.22.3/debian/patches/xdmcp-display-factory-explicitly-stop-greeter-sessio.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/xdmcp-display-factory-explicitly-stop-greeter-sessio.patch 2017-09-23 11:09:06.000000000 +0200
@@ -0,0 +1,28 @@
+From da8c3a632ad1642a5e06efecbb2b58ab3298c93c Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 14:59:05 -0400
+Subject: [PATCH] xdmcp-display-factory: explicitly stop greeter session on
+ disconnect
+
+If the client disconnects, we should kill off the necessary processes.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ daemon/gdm-xdmcp-display-factory.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
+index c5f7ddb4..3a8506ce 100644
+--- a/daemon/gdm-xdmcp-display-factory.c
++++ b/daemon/gdm-xdmcp-display-factory.c
+@@ -2056,6 +2056,7 @@ on_client_disconnected (GdmSession *session,
+ if (gdm_display_get_status (display) != GDM_DISPLAY_MANAGED)
+ return;
+
++ gdm_display_stop_greeter_session (display);
+ gdm_display_unmanage (display);
+ gdm_display_finish (display);
+ }
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/xdmcp-display-factory-fix-signal-prototype.patch gdm3-3.22.3/debian/patches/xdmcp-display-factory-fix-signal-prototype.patch
--- gdm3-3.22.3/debian/patches/xdmcp-display-factory-fix-signal-prototype.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/xdmcp-display-factory-fix-signal-prototype.patch 2017-09-23 11:09:06.000000000 +0200
@@ -0,0 +1,30 @@
+From 8732c4dbf4995939b69b0981557a5dfe16cb91ed Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Fri, 31 Mar 2017 14:58:26 -0400
+Subject: [PATCH] xdmcp-display-factory: fix signal prototype
+
+The callback was getting called with the wrong arguments leading
+to spew in the logs and necessary code not getting run!
+
+https://bugzilla.gnome.org/show_bug.cgi?id=780787
+---
+ daemon/gdm-xdmcp-display-factory.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
+index b9ab921c..c5f7ddb4 100644
+--- a/daemon/gdm-xdmcp-display-factory.c
++++ b/daemon/gdm-xdmcp-display-factory.c
+@@ -2050,7 +2050,8 @@ on_hostname_selected (GdmXdmcpChooserDisplay *display,
+ }
+
+ static void
+-on_client_disconnected (GdmDisplay *display)
++on_client_disconnected (GdmSession *session,
++ GdmDisplay *display)
+ {
+ if (gdm_display_get_status (display) != GDM_DISPLAY_MANAGED)
+ return;
+--
+2.14.1
+
diff -Nru gdm3-3.22.3/debian/patches/xdmcp-display-factory-more-signal-prototype-fixing.patch gdm3-3.22.3/debian/patches/xdmcp-display-factory-more-signal-prototype-fixing.patch
--- gdm3-3.22.3/debian/patches/xdmcp-display-factory-more-signal-prototype-fixing.patch 1970-01-01 01:00:00.000000000 +0100
+++ gdm3-3.22.3/debian/patches/xdmcp-display-factory-more-signal-prototype-fixing.patch 2017-09-23 11:09:06.000000000 +0200
@@ -0,0 +1,56 @@
+From e610534c841c254fb83c36fef1ac3ec2e9707d11 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode at redhat.com>
+Date: Thu, 21 Sep 2017 09:20:46 -0400
+Subject: [PATCH] xdmcp-display-factory: more signal prototype fixing
+
+commit 2a3d5a7c402534c3611956fed930394a51cb00c5 attempted to fix
+the signal prototype of on_client_disconnected to match the marshalled
+arguments. Unfortunately, the handler is used for two different
+signals:
+
+1) when a user chooses "Disconnect" from the chooser menu
+2) when a user closes the Xephyr window (or turns off the thin client
+or whatever)
+
+The signals have slightly different prototypes, so commit 2a3d5a7c
+fixed 2), but broke 1).
+
+This commit massages the signal connections and handler signature to
+work for both cases.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=787987
+---
+ daemon/gdm-xdmcp-display-factory.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
+index 3a8506ce..46a0d9ff 100644
+--- a/daemon/gdm-xdmcp-display-factory.c
++++ b/daemon/gdm-xdmcp-display-factory.c
+@@ -2050,8 +2050,7 @@ on_hostname_selected (GdmXdmcpChooserDisplay *display,
+ }
+
+ static void
+-on_client_disconnected (GdmSession *session,
+- GdmDisplay *display)
++on_client_disconnected (GdmDisplay *display)
+ {
+ if (gdm_display_get_status (display) != GDM_DISPLAY_MANAGED)
+ return;
+@@ -2115,11 +2114,11 @@ on_display_status_changed (GdmDisplay *display,
+ g_signal_connect_object (G_OBJECT (session),
+ "client-disconnected",
+ G_CALLBACK (on_client_disconnected),
+- display, 0);
++ display, G_CONNECT_SWAPPED);
+ g_signal_connect_object (G_OBJECT (session),
+ "disconnected",
+ G_CALLBACK (on_client_disconnected),
+- display, 0);
++ display, G_CONNECT_SWAPPED);
+ }
+ break;
+ default:
+--
+2.14.1
+
More information about the pkg-gnome-maintainers
mailing list