On 1/18/07, Graham Smith <[EMAIL PROTECTED]> wrote:
xauth info on both systems are the same.
The output of xhost is the same.


I tried it myself and I get the exact same results.  I've never seen
sudo misbehave this way and I use every day (though only Solaris and
FreeBSD) including for remotely displaying X apps like veritas
netbackup.  Normally the environment variables are not completely
wiped out, but this is not the case here.

printenv HOME
/home/aharrison
printenv DISPLAY
:0.0
sudo printenv HOME
/root
sudo printenv DISPLAY


The DISPLAY variable is clearly getting flushed.  The ONLY way I could
get it to work on my 10.2 system was:

cat /tmp/test.sh
#!/usr/bin/sh
if [ -z "$DISPLAY" ] ; then
 export DISPLAY=":0.0"
fi
xcalc

sudo /tmp/test.sh

And up pops xcalc.

Obviously this method would fail if you wanted to tunnel the display
through ssh.

Just to make sure I'm not dreaming I tried it and here it is working
successfully on Solaris.

> printenv PWD
/tmp
printenv DISPLAY
localhost:10.0
sudo printenv PWD
/tmp
sudo printenv DISPLAY
localhost:10.0

DISPLAY is not getting squashed.

--
Andy Harrison
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to