On 10/01/2009 11:34 AM, Arthur D. wrote:
> Thanks for your replies, guys.
> 
>> 2. Change the default editor on your system by putting something in
>> /etc/env.d:
>>
>> apollo ~ # cat /etc/env.d/99editor
>> EDITOR="vim"
>>
>> --Mike
> ===================================================
> spi...@supervisor ~ $ cat /etc/env.d/99editor
> # Configuration file for eselect
> # This file has been automatically generated.
> EDITOR="/usr/bin/vim"
> spi...@supervisor ~ $ sudo visudo
> visudo: no editor found (editor path = /bin/nano)
> ===================================================
> 
> The first option works fine, but ... how much time should the user
> spend to get things just work as expected?
> Yes, there are such geeks like me and you, who will spend his time
> doing what should already be done by maintainers.
> 
> Look in the man page, it's far from obvious why isn't EDITOR variable
> respected.

>From the sudoers man page:

env_reset       If set, sudo will reset the environment to only contain
the LOGNAME, SHELL, USER, USERNAME and the SUDO_* variables.  Any
variables in the caller's environment that match the env_keep and
env_check lists are then added.  The default contents of the env_keep
and env_check lists are displayed when sudo is run by root with the -V
option.  If the secure_path option is set, its value will be used for
the PATH environment variable. This flag is on by default.

Looks pretty clear to me.  The default to to ditch EDITOR along with
other potentially dangerous environment variables.

Doug


Reply via email to