summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2009-03-20 02:23:04 +0000
committerRay Strode <halfline@src.gnome.org>2009-03-20 02:23:04 +0000
commit08cae13149f5582b27af2fcd5bdaf4924ebdae03 (patch)
tree56b178fe6a465cfdf07001ab108bf8e06ade7e5a
parent65ab52f6714827e146ffdaeb7d8fbeceab328a05 (diff)
downloadgdm-08cae13149f5582b27af2fcd5bdaf4924ebdae03.tar.gz
Use gethostname() instead of g_get_host_name(), in xauth database since
2009-03-19 Ray Strode <rstrode@redhat.com> * daemon/gdm-display-access-file.c (_get_auth_info_for_display): Use gethostname() instead of g_get_host_name(), in xauth database since the latter doesn't give up to date information when the hostname changes. svn path=/trunk/; revision=6791
-rw-r--r--ChangeLog8
-rw-r--r--daemon/gdm-display-access-file.c7
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f48e72a2..e918c981 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,14 @@
2009-03-19 Ray Strode <rstrode@redhat.com>
* daemon/gdm-display-access-file.c
+ (_get_auth_info_for_display):
+ Use gethostname() instead of g_get_host_name(),
+ in xauth database since the latter doesn't give
+ up to date information when the hostname changes.
+
+2009-03-19 Ray Strode <rstrode@redhat.com>
+
+ * daemon/gdm-display-access-file.c
(_create_xauth_file_for_user),
(_clean_up_stale_auth_subdirs):
Remove empty auth subdirs which can
diff --git a/daemon/gdm-display-access-file.c b/daemon/gdm-display-access-file.c
index 82b2b763..071e6a45 100644
--- a/daemon/gdm-display-access-file.c
+++ b/daemon/gdm-display-access-file.c
@@ -438,8 +438,13 @@ _get_auth_info_for_display (GdmDisplayAccessFile *file,
gdm_display_is_local (display, &is_local, NULL);
if (is_local) {
+ char localhost[HOST_NAME_MAX + 1] = "";
*family = FamilyLocal;
- *address = g_strdup (g_get_host_name ());
+ if (gethostname (localhost, HOST_NAME_MAX) == 0) {
+ *address = g_strdup (localhost);
+ } else {
+ *address = g_strdup ("localhost");
+ }
} else {
*family = FamilyWild;
gdm_display_get_remote_hostname (display, address, NULL);