When running xauth I would always get the error message: xauth: (stdin):2: unknown command: "7ef....." <where 7ef was the start of a nice magic cookie> , though all would start fine regardless. This is as the "xauth list localhost:0" command used to ascertain the magic cookie in use returns 2 lines, while the sed involved only expects one. This is I expect not expected behaviour (I don't understand X very well), but nevertheless startx should handle it better. Following is a one line patch to startx to only grab and use the first line with xauth. Something more complex could perhaps be crafted, but not by me with my limited working knowledge of X. --- startx 2007-11-17 20:54:13.000000000 +0000 +++ startx 2007-11-30 15:55:25.000000000 +0000 @@ -118,6 +118,7 @@ serverargs=${serverargs}" -auth "${xserv # server man need it. Add them to the '$xserverauthfile' instead. for displayname in $authdisplay $hostname$authdisplay; do authcookie=`xauth list "$displayname" \ + | tail -n 1 \ | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; if [ "z${authcookie}" = "z" ] ; then xauth -q << EOF Tested on my x86 Gentoo 2007.0 box without problem.
Same issue at http://bugs.gentoo.org/show_bug.cgi?id=131308 .
I encountered this bug too on ArchLinux. I have played around with /etc/hosts and "xauth list" and have concluded that xauth DOES make a difference between IPv4 and IPv6 addresses. My /etc/hosts looks like 127.0.0.1 localhost.localdomain localhost arch ::1 localhost.localdomain localhost And "xauth list localhost:0" give me TWO identical lines whereas "xauth list arch:0" gives me ONE line with contents identical to the localhost case. If I add "arch" hostname to ::1 in /etc/hostname, "xauth list arch:0" gives me TWO lines identical to the localhost case. I think it would be better to improve /usr/bin/startx to take only one of two identical lines. Just as Nick White did in his patch.
Created attachment 49839 [details] startx patch
I have had a conversation on irc.freenode.net#xorg-devel with an active contributor of Xorg "ajax". He told me that I need to do $xauth list localhost/unix:0 in startx, i.e. specify that we request info just about unix sockets. After applying the attached startx patch startx works without error messages.
Can you please send your patch to xorg-devel for review.
Mass closure: This bug has been untouched for more than six years, and is not obviously still valid. Please reopen this bug or file a new report if you continue to experience issues with current releases.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.