On Mon, Mar 06, 2006 at 08:08:35AM -0500, Haines Brown wrote:
$ echo $DISPLAY
:0.0
$ sudo echo $DISPLAY
:0.0
That seemed OK, but when I did:
$ sudo env | grep DISPLAY
[nothing returned]
Why do I get inconsistent results? In the first case, the
value of DISPLAY is known, but in the second when I use
env, it is not found in the environment accessed by sudo.
In the first case, the shell expands $DISPLAY on the
command-line before sudo is executed.
sudo no longer lets DISPLAY through without you telling it
to first: actually, sudo has changed from a blacklist to a
whitelist model for environment variables.