Bug 1000 - Failing resolution of conflicting def_editor and env_editor
Failing resolution of conflicting def_editor and env_editor
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Visudo
1.9.8
PC Linux
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2021-09-29 08:38 MDT by thomas.luebking
Modified: 2022-01-27 19:51 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.