Blob Blame History Raw
From 0e661d99508a71e7b8e1a28d68019d2c4f14eec4 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Tue, 15 Sep 2020 00:41:00 -0400
Subject: [PATCH 2/3] session: Don't leak remote greeter interface

XDMCP login screens get a "Remote Geeter Interface" exported over
the bus connection (so the login window can provide a Disconnect
button).

This interface is getting leaked when the session object is disposed,
leaving the bus connection itself undisposed, which causes an fd
leak.

This commit plugs the interface leak, and thus the fd leak.
---
 daemon/gdm-session.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 930d01e14..e4d750982 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -3592,60 +3592,61 @@ gdm_session_get_property (GObject    *object,
                 break;
 #ifdef ENABLE_WAYLAND_SUPPORT
         case PROP_IGNORE_WAYLAND:
                 g_value_set_boolean (value, self->priv->ignore_wayland);
                 break;
 #endif
         default:
                 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
                 break;
         }
 }
 
 static void
 gdm_session_dispose (GObject *object)
 {
         GdmSession *self;
 
         self = GDM_SESSION (object);
 
         g_debug ("GdmSession: Disposing session");
 
         gdm_session_close (self);
 
         g_clear_pointer (&self->priv->conversations,
                          g_hash_table_unref);
 
         g_clear_object (&self->priv->user_verifier_interface);
         g_clear_pointer (&self->priv->user_verifier_extensions,
                          g_hash_table_unref);
         g_clear_object (&self->priv->greeter_interface);
+        g_clear_object (&self->priv->remote_greeter_interface);
         g_clear_object (&self->priv->chooser_interface);
 
         g_free (self->priv->display_name);
         self->priv->display_name = NULL;
 
         g_free (self->priv->display_hostname);
         self->priv->display_hostname = NULL;
 
         g_free (self->priv->display_device);
         self->priv->display_device = NULL;
 
         g_free (self->priv->display_seat_id);
         self->priv->display_seat_id = NULL;
 
         g_free (self->priv->display_x11_authority_file);
         self->priv->display_x11_authority_file = NULL;
 
         g_strfreev (self->priv->conversation_environment);
         self->priv->conversation_environment = NULL;
 
         if (self->priv->worker_server != NULL) {
                 g_dbus_server_stop (self->priv->worker_server);
                 g_clear_object (&self->priv->worker_server);
         }
 
         if (self->priv->outside_server != NULL) {
                 g_dbus_server_stop (self->priv->outside_server);
                 g_clear_object (&self->priv->outside_server);
         }
 
-- 
2.26.2