[sudo-users] per-user editor for visudo

Todd C. Miller Todd.Miller at courtesan.com
Sat Jul 30 15:13:52 MDT 2016

On Sat, 30 Jul 2016 18:38:38 +0200, balducci at units.it wrote:

> Instead, I find that the editor option in Defaults:balducci is
> silently ignored, without any warning/error message from visudo.
> In the end: it looks to me that the only way a user has to set an
> editor different from the default is via the EDITOR/VISUAL
> environment variable (when allowed as per above).
> Is this correct? Is there any obvious reason why the editor
> option is ignored when in a Defaults:<user> entry?

The reason this doesn't work is that visudo is being run as root
and so the editor Defaults setting will match on root, not the user
running "sudo visudo".

It would be possible for visudo to look at the SUDO_USER environment
variable but it does not currently do that.

 - todd

More information about the sudo-users mailing list