Blame SOURCES/0041-xdmcp-display-factory-don-t-return-value-from-foreac.patch

400dab
From 323358ef61d969588ea048d5b0eba6fd102d3dcf Mon Sep 17 00:00:00 2001
400dab
From: Ray Strode <rstrode@redhat.com>
400dab
Date: Thu, 21 Feb 2019 15:20:01 -0500
400dab
Subject: [PATCH 41/51] xdmcp-display-factory: don't return value from foreach
400dab
 funcs
400dab
400dab
The xdmcp code is returning TRUE from its display store foreach
400dab
functions, which is useless since commit 47d01abe and wrong
400dab
before that.
400dab
400dab
This commit makes it return void instead.
400dab
---
400dab
 daemon/gdm-xdmcp-display-factory.c | 8 ++------
400dab
 1 file changed, 2 insertions(+), 6 deletions(-)
400dab
400dab
diff --git a/daemon/gdm-xdmcp-display-factory.c b/daemon/gdm-xdmcp-display-factory.c
400dab
index 5b5786c6f..2e14beab4 100644
400dab
--- a/daemon/gdm-xdmcp-display-factory.c
400dab
+++ b/daemon/gdm-xdmcp-display-factory.c
400dab
@@ -639,76 +639,74 @@ gdm_xdmcp_host_allow (GdmAddress *address)
400dab
 {
400dab
 #ifdef HAVE_TCPWRAPPERS
400dab
         char       *client;
400dab
         char       *host;
400dab
         gboolean    ret;
400dab
 
400dab
         host = NULL;
400dab
         client = NULL;
400dab
 
400dab
         /* Find client hostname */
400dab
         gdm_address_get_hostname (address, &client);
400dab
         gdm_address_get_numeric_info (address, &host, NULL);
400dab
 
400dab
         /* Check with tcp_wrappers if client is allowed to access */
400dab
         ret = hosts_ctl ("gdm", client, host, "");
400dab
 
400dab
         g_free (host);
400dab
         g_free (client);
400dab
 
400dab
         return ret;
400dab
 #else /* HAVE_TCPWRAPPERS */
400dab
         return (TRUE);
400dab
 #endif /* HAVE_TCPWRAPPERS */
400dab
 }
400dab
 
400dab
 typedef struct {
400dab
         GdmAddress *address;
400dab
         int         count;
400dab
 } CountDisplayData;
400dab
 
400dab
-static gboolean
400dab
+static void
400dab
 count_displays_from_host (const char       *id,
400dab
                           GdmDisplay       *display,
400dab
                           CountDisplayData *data)
400dab
 {
400dab
         GdmAddress *address;
400dab
 
400dab
         if (GDM_IS_XDMCP_DISPLAY (display)) {
400dab
                 address = gdm_xdmcp_display_get_remote_address (GDM_XDMCP_DISPLAY (display));
400dab
 
400dab
                 if (gdm_address_equal (address, data->address)) {
400dab
                         data->count++;
400dab
                 }
400dab
         }
400dab
-
400dab
-        return TRUE;
400dab
 }
400dab
 
400dab
 static int
400dab
 gdm_xdmcp_num_displays_from_host (GdmXdmcpDisplayFactory *factory,
400dab
                                   GdmAddress             *address)
400dab
 {
400dab
         CountDisplayData data;
400dab
         GdmDisplayStore *store;
400dab
 
400dab
         data.count = 0;
400dab
         data.address = address;
400dab
 
400dab
         store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
400dab
         gdm_display_store_foreach (store,
400dab
                                    (GdmDisplayStoreFunc)count_displays_from_host,
400dab
                                    &data);
400dab
 
400dab
         return data.count;
400dab
 }
400dab
 
400dab
 typedef struct {
400dab
         GdmAddress *address;
400dab
         int         display_num;
400dab
 } LookupHostData;
400dab
 
400dab
 static gboolean
400dab
 lookup_by_host (const char     *id,
400dab
                 GdmDisplay     *display,
400dab
                 LookupHostData *data)
400dab
 {
400dab
@@ -1780,78 +1778,76 @@ gdm_xdmcp_send_managed_forward (GdmXdmcpDisplayFactory *factory,
400dab
 
400dab
 static void
400dab
 gdm_xdmcp_send_got_managed_forward (GdmXdmcpDisplayFactory *factory,
400dab
                                     GdmAddress             *address,
400dab
                                     GdmAddress             *origin)
400dab
 {
400dab
         ARRAY8      addr;
400dab
         XdmcpHeader header;
400dab
         char       *host;
400dab
 
400dab
         host = NULL;
400dab
         gdm_address_get_numeric_info (address, &host, NULL);
400dab
         g_debug ("GdmXdmcpDisplayFactory: Sending GOT_MANAGED_FORWARD to %s",
400dab
                 host ? host : "(null)");
400dab
         g_free (host);
400dab
 
400dab
         set_address_for_request (origin, &addr);
400dab
 
400dab
         header.opcode = (CARD16) GDM_XDMCP_GOT_MANAGED_FORWARD;
400dab
         header.length = 4 + addr.length;
400dab
         header.version = GDM_XDMCP_PROTOCOL_VERSION;
400dab
         XdmcpWriteHeader (&factory->priv->buf, &header);
400dab
 
400dab
         XdmcpWriteARRAY8 (&factory->priv->buf, &addr);
400dab
         XdmcpFlush (factory->priv->socket_fd,
400dab
                     &factory->priv->buf,
400dab
                     (XdmcpNetaddr)gdm_address_peek_sockaddr_storage (address),
400dab
                     (int)gdm_sockaddr_len (gdm_address_peek_sockaddr_storage (address)));
400dab
 }
400dab
 
400dab
-static gboolean
400dab
+static void
400dab
 count_sessions (const char             *id,
400dab
                 GdmDisplay             *display,
400dab
                 GdmXdmcpDisplayFactory *factory)
400dab
 {
400dab
         if (GDM_IS_XDMCP_DISPLAY (display)) {
400dab
                 int status;
400dab
 
400dab
                 status = gdm_display_get_status (display);
400dab
 
400dab
                 if (status == GDM_DISPLAY_MANAGED) {
400dab
                         factory->priv->num_sessions++;
400dab
                 } else if (status == GDM_DISPLAY_UNMANAGED) {
400dab
                         factory->priv->num_pending_sessions++;
400dab
                 }
400dab
         }
400dab
-
400dab
-        return TRUE;
400dab
 }
400dab
 
400dab
 static void
400dab
 gdm_xdmcp_recount_sessions (GdmXdmcpDisplayFactory *factory)
400dab
 {
400dab
         GdmDisplayStore *store;
400dab
 
400dab
         factory->priv->num_sessions = 0;
400dab
         factory->priv->num_pending_sessions = 0;
400dab
 
400dab
         store = gdm_display_factory_get_display_store (GDM_DISPLAY_FACTORY (factory));
400dab
         gdm_display_store_foreach (store,
400dab
                                    (GdmDisplayStoreFunc)count_sessions,
400dab
                                    factory);
400dab
 }
400dab
 
400dab
 static gboolean
400dab
 purge_displays (const char             *id,
400dab
                 GdmDisplay             *display,
400dab
                 GdmXdmcpDisplayFactory *factory)
400dab
 {
400dab
         if (GDM_IS_XDMCP_DISPLAY (display)) {
400dab
                 int status;
400dab
                 time_t currtime;
400dab
                 time_t acctime;
400dab
 
400dab
                 currtime = time (NULL);
400dab
                 status = gdm_display_get_status (display);
400dab
                 acctime = gdm_display_get_creation_time (display);
400dab
 
400dab
-- 
400dab
2.27.0
400dab