diff options
author | Egbert Eich <eich@suse.de> | 2005-04-20 17:54:12 +0000 |
---|---|---|
committer | Egbert Eich <eich@suse.de> | 2005-04-20 17:54:12 +0000 |
commit | dd7fee44b126636d6c3edd9e325ce411e3ae5d78 (patch) | |
tree | 2e378e28b91d651459f3f2c9ec40da15d595383e /startx.cpp | |
parent | 4118bc8579ac75620ea6cda2b16d3ebbe4f5b6af (diff) |
Separate server auth and client .Xautority file in startx. .Xautority mightsco_port_update-baseXORG-6_8_99_9XORG-6_8_99_8XORG-6_8_99_7XORG-6_8_99_6XORG-6_8_99_5XORG-6_8_99_4XORG-6_8_99_15XORG-6_8_99_14XORG-6_8_99_13XORG-6_8_99_12XORG-6_8_99_11XORG-6_8_99_10
have credentials from other Xservers which we might not want to enable
on ours Bugzilla #3078).
Diffstat (limited to 'startx.cpp')
-rw-r--r-- | startx.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
@@ -162,14 +162,34 @@ esac authdisplay=${display:-:0} mcookie=`MK_COOKIE` +dummy=0 + +XCOMM create a file with auth information for the server. ':0' is a dummy. +xserverauthfile=$HOME/.serverauth.$$ +xauth -q -f $xserverauthfile << EOF +add :$dummy . $mcookie +EOF +serverargs=${serverargs}" -auth "${xserverauthfile} + +XCOMM now add the same credentials to the client authority file +XCOMM if '$displayname' already exists don't overwrite it as another +XCOMM server man need it. Add them to the '$xserverauthfile' instead. for displayname in $authdisplay $hostname$authdisplay; do - if ! xauth list "$displayname" | grep "$displayname " >/dev/null 2>&1; then + authcookie=`xauth list "$displayname" @@ + | sed -n "s/.*$displayname[[:space:]*].*[[:space:]*]//p"` 2>/dev/null; + if [ "z${authcookie}" == "z" ] ; then xauth -q << EOF add $displayname . $mcookie EOF removelist="$displayname $removelist" + else + dummy=$((dummy+1)); + xauth -q -f $xserverauthfile << EOF +add :$dummy . $authcookie +EOF fi done + #endif xinit $client $clientargs -- $server $display $serverargs @@ -177,7 +197,10 @@ xinit $client $clientargs -- $server $display $serverargs if [ x"$removelist" != x ]; then xauth remove $removelist fi - +if [ x"$xserverauthfile" != x ]; then + rm -f $xserverauthfile +fi + /* * various machines need special cleaning up */ |