diff options
Diffstat (limited to 'kinit/wrapper.c')
-rw-r--r-- | kinit/wrapper.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kinit/wrapper.c b/kinit/wrapper.c index 27d208376..7e08d49ca 100644 --- a/kinit/wrapper.c +++ b/kinit/wrapper.c @@ -164,7 +164,9 @@ static int openSocket() sock_file[strlen(sock_file)-1] = 0; strncat(sock_file, "/socket-", MAX_SOCK_FILE - strlen(sock_file)); - if (gethostname(sock_file+strlen(sock_file), MAX_SOCK_FILE - strlen(sock_file) - 1) != 0) + if( getenv("XAUTHLOCALHOSTNAME")) + strncat(sock_file, getenv("XAUTHLOCALHOSTNAME"), MAX_SOCK_FILE - strlen(sock_file) - 1); + else if (gethostname(sock_file+strlen(sock_file), MAX_SOCK_FILE - strlen(sock_file) - 1) != 0) { perror("Warning: Could not determine hostname: "); return -1; |