--- xinit.orig/startx.cpp 2010-05-15 07:26:07.000000000 +0400 +++ xinit/startx.cpp 2011-08-02 16:04:19.324739469 +0400 @@ -292,7 +292,7 @@ XCOMM server man need it. Add them to the '$xserverauthfile' instead. for displayname in $authdisplay $hostname$authdisplay; do authcookie=`XAUTH list "$displayname" @@ - | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; + | head -n 1 | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; if [ "z${authcookie}" = "z" ] ; then XAUTH -q << EOF add $displayname . $mcookie