[sudo-users] per-user editor for visudo

balducci at units.it balducci at units.it
Mon Aug 1 01:13:44 MDT 2016


> 
> The last match wins, which in this case is the global Defaults line.
> 

Oh yes! I knew that (it is clearly stated in man sudoers) but I didn't
recall it!


> Because it is not sudo that uses the "editor" setting, it is visudo
> that does and visudo is being run as root, not balducci.  I've

OK: I think I've got the point now.

Options like timestamp_timeout env_reset tty_tickets etc are expected to
be consumed by sudo; OTOH the editor option matters for visudo and not
for sudo (and, as you say, visudo runs as root when invoked as "sudo
visudo").

> committed a change in visudo to check the SUDO_USER environment
> variable and use that if it is set and visudo is run as root.
> A better option might be for sudo to pass the editor for visudo on
> the command line, which I am considering.

I'll build the latest commit and report

thank you very much for your time and patience

ciao
-gabriele


More information about the sudo-users mailing list