From b11184b8f54e00265aabe818a7b8a8da0f4950e7 Mon Sep 17 00:00:00 2001 From: Vidar Hokstad Date: Tue, 1 Aug 2023 20:14:47 +0100 Subject: [PATCH] Improved authentication resilience --- lib/X11/display.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/X11/display.rb b/lib/X11/display.rb index 902f8db..9e3a3b5 100644 --- a/lib/X11/display.rb +++ b/lib/X11/display.rb @@ -1,8 +1,12 @@ +# FIXME: Temp workaround +require 'stringio' + module X11 class DisplayError < X11Error; end class ConnectionError < X11Error; end class AuthorizationError < X11Error; end + class ProtocolError < X11Error; end class Display attr_accessor :socket @@ -47,7 +51,8 @@ module X11 private def authorize(host, family, display_id) - auth_info = Auth.new.get_by_hostname(host||"localhost", family, display_id) + auth = Auth.new + auth_info = auth.get_by_hostname(host||"localhost", family, display_id) auth_name, auth_data = auth_info.address, auth_info.auth_data handshake = Form::ClientHandshake.new(