diff options
author | Ray Strode <rstrode@redhat.com> | 2009-03-20 02:23:04 +0000 |
---|---|---|
committer | Ray Strode <halfline@src.gnome.org> | 2009-03-20 02:23:04 +0000 |
commit | 08cae13149f5582b27af2fcd5bdaf4924ebdae03 (patch) | |
tree | 56b178fe6a465cfdf07001ab108bf8e06ade7e5a | |
parent | 65ab52f6714827e146ffdaeb7d8fbeceab328a05 (diff) | |
download | gdm-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-- | ChangeLog | 8 | ||||
-rw-r--r-- | daemon/gdm-display-access-file.c | 7 |
2 files changed, 14 insertions, 1 deletions
@@ -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); |