[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Using setenv DISPLAY



On Wed, Mar 08, 2006 at 02:30:06PM -0500, Haines Brown wrote:
> Andrew Cady <d@jerkface.net> writes:
> 
> > As others have pointed out, sudo does not by default preserve its
> > environment when starting privileged processes.  To get X working, you
> > will want to have sudoers retain both DISPLAY and XAUTHORITY.

[...]

> In the discussion of this sudo "bug" (upgrade), it was suggested to
> add this line to /etc/sudoers:
> 
>     Defaults env_reset,env_keep+="DISPLAY HOME XAUTHORIZATION"

Other than the fact that the proper variable is XAUTHORITY rather than
XAUTHORIZATION, this line is correct.  It is not safe to retain HOME,
though.

If sudo is complaining of a syntax error in sudoers then something else
must be causing it.  By the way, always edit sudoers with visudo; then
you will never receive syntax errors from sudo.



Reply to: