Subject: | X11::Auth fails when XAUTHORITY is for "localhost" instead of correct hostname |
Date: | Tue, 14 Feb 2012 14:20:24 +0100 |
To: | bug-X11-Protocol [...] rt.cpan.org |
From: | Varga Gábor <vargusz [...] fazekas.hu> |
Distribution: X11-Protocol-0.56
Perl version: v5.14.2 built for i586-linux-thread-multi
Platform: openSUSE 12.1, 32-bit Linux kernel 3.2.4
The function X11::Auth->get_by_host() tries to find the X11 magic cookie
for the host name returned by Sys::Hostname::hostname(), but if the file
referenced by the XAUTHORITY variable contains "localhost" as the
hostname instead of the real hostname, the for loop does not find the
correct authentication token, and the function returns an empty list.
Using "localhost" instead of the actual hostname is probably
openSUSE-specific, and they store this hostname to use for X11
authentication in the environment variable called XAUTHLOCALHOSTNAME.
However, using "localhost" in there is perfectly valid, I think.
A longer discussion of the issue can be found in the Novell Bugzilla as
bug #746894 [1], where a proposed patch is also attached. This patch
contains two independent attempts to fix this issue, and I think that
either of them should be enough; and the second part might be suitable
for inclusion in the upstream X11:Auth Perl module.
[1] https://bugzilla.novell.com/show_bug.cgi?id=746894
Gábor Varga
Message body is not shown because sender requested not to inline it.