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