Blame SOURCES/0001-display-access-file-drop-unused-function.patch

f83012
From fb55ec1c2e2957eb4c11a220874e5089fd357286 Mon Sep 17 00:00:00 2001
f83012
From: Ray Strode <rstrode@redhat.com>
f83012
Date: Wed, 16 May 2018 14:06:29 -0400
f83012
Subject: [PATCH] display-access-file: drop unused function
f83012
f83012
gdm_display_access_file_remove_display is unused.
f83012
f83012
This commit drops it.
f83012
f83012
https://bugzilla.gnome.org/show_bug.cgi?id=796176
f83012
---
f83012
 daemon/gdm-display-access-file.c | 79 --------------------------------
f83012
 daemon/gdm-display-access-file.h |  3 --
f83012
 2 files changed, 82 deletions(-)
f83012
f83012
diff --git a/daemon/gdm-display-access-file.c b/daemon/gdm-display-access-file.c
f83012
index 9bf818d2a..c1f0f17a8 100644
f83012
--- a/daemon/gdm-display-access-file.c
f83012
+++ b/daemon/gdm-display-access-file.c
f83012
@@ -536,139 +536,60 @@ gdm_display_access_file_add_display_with_cookie (GdmDisplayAccessFile  *file,
f83012
             || fflush (file->priv->fp) == EOF) {
f83012
                 g_set_error (error,
f83012
                         G_FILE_ERROR,
f83012
                         g_file_error_from_errno (errno),
f83012
                         "%s", g_strerror (errno));
f83012
                 display_added = FALSE;
f83012
         } else {
f83012
                 display_added = TRUE;
f83012
         }
f83012
 
f83012
         /* If we wrote a FamilyLocal entry, we still want a FamilyWild
f83012
          * entry, because it's more resiliant against hostname changes
f83012
          *
f83012
          */
f83012
         if (auth_entry.family == FamilyLocal) {
f83012
                 auth_entry.family = FamilyWild;
f83012
 
f83012
                 if (XauWriteAuth (file->priv->fp, &auth_entry)
f83012
                     && fflush (file->priv->fp) != EOF) {
f83012
                         display_added = TRUE;
f83012
                 }
f83012
         }
f83012
 
f83012
         g_free (auth_entry.address);
f83012
         g_free (auth_entry.number);
f83012
         g_free (auth_entry.name);
f83012
 
f83012
         return display_added;
f83012
 }
f83012
 
f83012
-gboolean
f83012
-gdm_display_access_file_remove_display (GdmDisplayAccessFile  *file,
f83012
-                                        GdmDisplay            *display,
f83012
-                                        GError               **error)
f83012
-{
f83012
-        Xauth           *auth_entry;
f83012
-        unsigned short  family;
f83012
-        unsigned short  address_length;
f83012
-        char           *address;
f83012
-        unsigned short  number_length;
f83012
-        char           *number;
f83012
-        unsigned short  name_length;
f83012
-        char           *name;
f83012
-
f83012
-        gboolean        result = FALSE;
f83012
-
f83012
-        g_return_val_if_fail (file != NULL, FALSE);
f83012
-        g_return_val_if_fail (file->priv->path != NULL, FALSE);
f83012
-
f83012
-        _get_auth_info_for_display (file, display,
f83012
-                                    &family,
f83012
-                                    &address_length,
f83012
-                                    &address,
f83012
-                                    &number_length,
f83012
-                                    &number,
f83012
-                                    &name_length,
f83012
-                                    &name);
f83012
-
f83012
-        auth_entry = XauGetAuthByAddr (family,
f83012
-                                       address_length,
f83012
-                                       address,
f83012
-                                       number_length,
f83012
-                                       number,
f83012
-                                       name_length,
f83012
-                                       name);
f83012
-        g_free (address);
f83012
-        g_free (number);
f83012
-        g_free (name);
f83012
-
f83012
-        if (auth_entry != NULL) {
f83012
-                XauDisposeAuth (auth_entry);
f83012
-                result = TRUE;
f83012
-        }
f83012
-
f83012
-        /* If FamilyLocal, we also added a FamilyWild entry,
f83012
-         * so we need to clean that up too
f83012
-         */
f83012
-        if (family == FamilyLocal) {
f83012
-                auth_entry = XauGetAuthByAddr (FamilyWild,
f83012
-                                               address_length,
f83012
-                                               address,
f83012
-                                               number_length,
f83012
-                                               number,
f83012
-                                               name_length,
f83012
-                                               name);
f83012
-
f83012
-                if (auth_entry != NULL) {
f83012
-                        XauDisposeAuth (auth_entry);
f83012
-                        result = TRUE;
f83012
-                }
f83012
-        }
f83012
-
f83012
-
f83012
-        if (result == FALSE) {
f83012
-                g_set_error (error,
f83012
-                             GDM_DISPLAY_ACCESS_FILE_ERROR,
f83012
-                             GDM_DISPLAY_ACCESS_FILE_ERROR_FINDING_AUTH_ENTRY,
f83012
-                             "could not find authorization entry");
f83012
-        } else if (fflush (file->priv->fp) == EOF) {
f83012
-                g_set_error (error,
f83012
-                             G_FILE_ERROR,
f83012
-                             g_file_error_from_errno (errno),
f83012
-                             "%s", g_strerror (errno));
f83012
-                result = FALSE;
f83012
-        }
f83012
-
f83012
-        return result;
f83012
-}
f83012
-
f83012
 void
f83012
 gdm_display_access_file_close (GdmDisplayAccessFile  *file)
f83012
 {
f83012
         char *auth_dir;
f83012
 
f83012
         g_return_if_fail (file != NULL);
f83012
         g_return_if_fail (file->priv->fp != NULL);
f83012
         g_return_if_fail (file->priv->path != NULL);
f83012
 
f83012
         errno = 0;
f83012
         if (g_unlink (file->priv->path) != 0) {
f83012
                 g_warning ("GdmDisplayAccessFile: Unable to remove X11 authority database '%s': %s",
f83012
                            file->priv->path,
f83012
                            g_strerror (errno));
f83012
         }
f83012
 
f83012
         /* still try to remove dir even if file remove failed,
f83012
            may have already been removed by someone else */
f83012
         /* we own the parent directory too */
f83012
         auth_dir = g_path_get_dirname (file->priv->path);
f83012
         if (auth_dir != NULL) {
f83012
                 errno = 0;
f83012
                 if (g_rmdir (auth_dir) != 0) {
f83012
                         g_warning ("GdmDisplayAccessFile: Unable to remove X11 authority directory '%s': %s",
f83012
                                    auth_dir,
f83012
                                    g_strerror (errno));
f83012
                 }
f83012
                 g_free (auth_dir);
f83012
         }
f83012
 
f83012
diff --git a/daemon/gdm-display-access-file.h b/daemon/gdm-display-access-file.h
f83012
index cc7de9e35..eff8dd011 100644
f83012
--- a/daemon/gdm-display-access-file.h
f83012
+++ b/daemon/gdm-display-access-file.h
f83012
@@ -50,39 +50,36 @@ struct _GdmDisplayAccessFile
f83012
         GdmDisplayAccessFilePrivate *priv;
f83012
 };
f83012
 
f83012
 struct _GdmDisplayAccessFileClass
f83012
 {
f83012
         GObjectClass parent_class;
f83012
 };
f83012
 
f83012
 enum _GdmDisplayAccessFileError
f83012
 {
f83012
         GDM_DISPLAY_ACCESS_FILE_ERROR_GENERAL = 0,
f83012
         GDM_DISPLAY_ACCESS_FILE_ERROR_FINDING_AUTH_ENTRY
f83012
 };
f83012
 
f83012
 GQuark                gdm_display_access_file_error_quark             (void);
f83012
 GType                 gdm_display_access_file_get_type                (void);
f83012
 
f83012
 GdmDisplayAccessFile *gdm_display_access_file_new                     (const char            *username);
f83012
 gboolean              gdm_display_access_file_open                    (GdmDisplayAccessFile  *file,
f83012
                                                                        GError               **error);
f83012
 gboolean              gdm_display_access_file_add_display             (GdmDisplayAccessFile  *file,
f83012
                                                                        GdmDisplay            *display,
f83012
                                                                        char                 **cookie,
f83012
                                                                        gsize                 *cookie_size,
f83012
                                                                        GError               **error);
f83012
 gboolean              gdm_display_access_file_add_display_with_cookie (GdmDisplayAccessFile  *file,
f83012
                                                                        GdmDisplay            *display,
f83012
                                                                        const char            *cookie,
f83012
                                                                        gsize                  cookie_size,
f83012
                                                                        GError               **error);
f83012
-gboolean              gdm_display_access_file_remove_display          (GdmDisplayAccessFile  *file,
f83012
-                                                                       GdmDisplay            *display,
f83012
-                                                                       GError               **error);
f83012
 
f83012
 void                  gdm_display_access_file_close                   (GdmDisplayAccessFile  *file);
f83012
 char                 *gdm_display_access_file_get_path                (GdmDisplayAccessFile  *file);
f83012
 
f83012
 G_END_DECLS
f83012
 #endif /* __GDM_DISPLAY_ACCESS_FILE_H__ */
f83012
-- 
f83012
2.17.1
f83012