From 09266ec3a23ee11324bf88f4f8a3800f770affb5 Mon Sep 17 00:00:00 2001 From: Vidar Hokstad Date: Thu, 23 Sep 2021 19:23:34 +0100 Subject: [PATCH] Correct ~/.Xauthority name --- lib/X11/auth.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/X11/auth.rb b/lib/X11/auth.rb index 9c3c976..42882e0 100644 --- a/lib/X11/auth.rb +++ b/lib/X11/auth.rb @@ -27,7 +27,7 @@ module X11 # The filename will be taken from the XAUTHORITY environment variable, # if present, or '.Xauthority' in the user's home directory, or it may be overridden # by an argument. - def initialize(path = ENV['XAUTHORITY'] || ENV['HOME'] + "/Xauthority") + def initialize(path = ENV['XAUTHORITY'] || ENV['HOME'] + "/.Xauthority") @file = File.open(path) end @@ -35,7 +35,7 @@ module X11 # If family is 'Internet', the host will be translated into an appropriate address by gethostbyname(). # If no data is found, returns nil def get_by_hostname(host, family, display_id) - host = `hostname`.chomp if host == 'localhost' or host == '127.0.0.1' + host = `hostname`.chomp if host == 'localhost' or host == '127.0.0.1' or host.nil? address = TCPSocket.gethostbyname(host) if family == :Internet # this line does nothing for now auth_data = nil