Bug 1000

Summary: Failing resolution of conflicting def_editor and env_editor
Product: Sudo Reporter: thomas.luebking
Component: VisudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.9.8   
Hardware: PC   
OS: Linux   

Description thomas.luebking 2021-09-29 08:38:05 MDT
https://bbs.archlinux.org/viewtopic.php?pid=1995344#p1995344

If the editors are restricted (to one) visudo will fail to use it if eg. $EDITOR is set to a disallowed value - despite efforts to make it ignore it.

The error message isn't particularily helpful either, but I guess one could just use the first allowed editor in case of a contradiction and certainly the variables should be ignored for "!env_editor"?
Comment 1 Todd C. Miller 2021-09-29 10:30:45 MDT
Thanks for reporting this.  It is fixed by the following commit:
https://www.sudo.ws/repos/sudo/rev/caa529a0cab6

The intent is to honor EDITOR, VISUAL or SUDO_EDITOR as long as they match one of the values in "editors" in sudoers.  If no match is found, the first editor listed in "editors" that exists should be used.
Comment 2 Todd C. Miller 2022-01-27 19:51:01 MST
The changes are present in the 1.9.9 release.