Blame SOURCES/0007-xdmcp-display-don-t-set-MANAGED-until-we-ve-connecte.patch

75a7a3
From 9367cdcb777cabacc5cb436155e4ab7c32dc74ef Mon Sep 17 00:00:00 2001
75a7a3
From: Ray Strode <rstrode@redhat.com>
75a7a3
Date: Fri, 31 Mar 2017 14:52:23 -0400
75a7a3
Subject: [PATCH 07/13] xdmcp-display: don't set MANAGED until we've connected
75a7a3
75a7a3
We don't want to start the greeter session until we've
75a7a3
successfully connected to the display ourselves!
75a7a3
75a7a3
This prevents a race where session processes may inadvertently
75a7a3
 get the initial connection to the display server, causing
75a7a3
premature resets.
75a7a3
---
75a7a3
 daemon/gdm-xdmcp-display.c | 3 +--
75a7a3
 1 file changed, 1 insertion(+), 2 deletions(-)
75a7a3
75a7a3
diff --git a/daemon/gdm-xdmcp-display.c b/daemon/gdm-xdmcp-display.c
75a7a3
index c9f9c3d2..630844f2 100644
75a7a3
--- a/daemon/gdm-xdmcp-display.c
75a7a3
+++ b/daemon/gdm-xdmcp-display.c
75a7a3
@@ -166,80 +166,79 @@ gdm_xdmcp_display_prepare (GdmDisplay *display)
75a7a3
                       NULL);
75a7a3
 
75a7a3
         if (launch_environment == NULL) {
75a7a3
                 launch_environment = gdm_create_greeter_launch_environment (display_name,
75a7a3
                                                                             seat_id,
75a7a3
                                                                             NULL,
75a7a3
                                                                             hostname,
75a7a3
                                                                             FALSE);
75a7a3
                 g_object_set (self, "launch-environment", launch_environment, NULL);
75a7a3
                 g_object_unref (launch_environment);
75a7a3
         }
75a7a3
 
75a7a3
         if (!gdm_display_create_authority (display)) {
75a7a3
                 g_warning ("Unable to set up access control for display %s",
75a7a3
                            display_name);
75a7a3
                 return FALSE;
75a7a3
         }
75a7a3
 
75a7a3
         return GDM_DISPLAY_CLASS (gdm_xdmcp_display_parent_class)->prepare (display);
75a7a3
 }
75a7a3
 
75a7a3
 static gboolean
75a7a3
 idle_connect_to_display (GdmXdmcpDisplay *self)
75a7a3
 {
75a7a3
         gboolean res;
75a7a3
 
75a7a3
         self->priv->connection_attempts++;
75a7a3
 
75a7a3
         res = gdm_display_connect (GDM_DISPLAY (self));
75a7a3
         if (res) {
75a7a3
+                g_object_set (G_OBJECT (self), "status", GDM_DISPLAY_MANAGED, NULL);
75a7a3
         } else {
75a7a3
                 if (self->priv->connection_attempts >= MAX_CONNECT_ATTEMPTS) {
75a7a3
                         g_warning ("Unable to connect to display after %d tries - bailing out", self->priv->connection_attempts);
75a7a3
                         gdm_display_unmanage (GDM_DISPLAY (self));
75a7a3
                         return FALSE;
75a7a3
                 }
75a7a3
                 return TRUE;
75a7a3
         }
75a7a3
 
75a7a3
         return FALSE;
75a7a3
 }
75a7a3
 
75a7a3
 static void
75a7a3
 gdm_xdmcp_display_manage (GdmDisplay *display)
75a7a3
 {
75a7a3
         GdmXdmcpDisplay *self = GDM_XDMCP_DISPLAY (display);
75a7a3
 
75a7a3
         g_timeout_add (500, (GSourceFunc)idle_connect_to_display, self);
75a7a3
-
75a7a3
-        g_object_set (G_OBJECT (self), "status", GDM_DISPLAY_MANAGED, NULL);
75a7a3
 }
75a7a3
 
75a7a3
 static void
75a7a3
 gdm_xdmcp_display_class_init (GdmXdmcpDisplayClass *klass)
75a7a3
 {
75a7a3
         GObjectClass    *object_class = G_OBJECT_CLASS (klass);
75a7a3
         GdmDisplayClass *display_class = GDM_DISPLAY_CLASS (klass);
75a7a3
 
75a7a3
         object_class->get_property = gdm_xdmcp_display_get_property;
75a7a3
         object_class->set_property = gdm_xdmcp_display_set_property;
75a7a3
 
75a7a3
         display_class->prepare = gdm_xdmcp_display_prepare;
75a7a3
         display_class->manage = gdm_xdmcp_display_manage;
75a7a3
 
75a7a3
         g_type_class_add_private (klass, sizeof (GdmXdmcpDisplayPrivate));
75a7a3
 
75a7a3
         g_object_class_install_property (object_class,
75a7a3
                                          PROP_REMOTE_ADDRESS,
75a7a3
                                          g_param_spec_boxed ("remote-address",
75a7a3
                                                              "Remote address",
75a7a3
                                                              "Remote address",
75a7a3
                                                              GDM_TYPE_ADDRESS,
75a7a3
                                                              G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
75a7a3
 
75a7a3
         g_object_class_install_property (object_class,
75a7a3
                                          PROP_SESSION_NUMBER,
75a7a3
                                          g_param_spec_int ("session-number",
75a7a3
                                                            "session-number",
75a7a3
                                                            "session-number",
75a7a3
                                                            G_MININT,
75a7a3
-- 
75a7a3
2.12.0
75a7a3