summaryrefslogtreecommitdiff
path: root/daemon/gdm-display-access-file.c
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 /daemon/gdm-display-access-file.c
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
Diffstat (limited to 'daemon/gdm-display-access-file.c')
-rw-r--r--daemon/gdm-display-access-file.c7
1 files changed, 6 insertions, 1 deletions
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);