When parsing def_editor, break out of the loop when we find the
first valid editor. Bug #714
This commit is contained in:
4
NEWS
4
NEWS
@@ -14,6 +14,10 @@ What's new in Sudo 1.8.15
|
|||||||
enabling the sudoedit_follow option in sudoers or on a per-command
|
enabling the sudoedit_follow option in sudoers or on a per-command
|
||||||
basis with the FOLLOW and NOFOLLOW tags. Bug #707.
|
basis with the FOLLOW and NOFOLLOW tags. Bug #707.
|
||||||
|
|
||||||
|
* Fixed a bug introduced in versino 1.8.14 that caused the last
|
||||||
|
valid editor in the sudoers "editor" list to be used by visudo
|
||||||
|
and sudoedit instead of the first. Bug #714.
|
||||||
|
|
||||||
What's new in Sudo 1.8.14p3
|
What's new in Sudo 1.8.14p3
|
||||||
|
|
||||||
* Fixed a bug introduced in sudo 1.8.14p2 that prevented sudo
|
* Fixed a bug introduced in sudo 1.8.14p2 that prevented sudo
|
||||||
|
@@ -1201,7 +1201,9 @@ find_editor(int nfiles, char **files, int *argc_out, char ***argv_out)
|
|||||||
if ((editor = getenv(*ev)) != NULL && *editor != '\0') {
|
if ((editor = getenv(*ev)) != NULL && *editor != '\0') {
|
||||||
editor_path = resolve_editor(editor, strlen(editor),
|
editor_path = resolve_editor(editor, strlen(editor),
|
||||||
nfiles, files, argc_out, argv_out, NULL);
|
nfiles, files, argc_out, argv_out, NULL);
|
||||||
if (editor_path == NULL && errno != ENOENT)
|
if (editor_path != NULL)
|
||||||
|
break;
|
||||||
|
if (errno != ENOENT)
|
||||||
debug_return_str(NULL);
|
debug_return_str(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -330,7 +330,9 @@ get_editor(int *editor_argc, char ***editor_argv)
|
|||||||
cp != NULL; cp = sudo_strsplit(NULL, def_editor_end, ":", &ep)) {
|
cp != NULL; cp = sudo_strsplit(NULL, def_editor_end, ":", &ep)) {
|
||||||
editor_path = resolve_editor(cp, (size_t)(ep - cp), 2, files,
|
editor_path = resolve_editor(cp, (size_t)(ep - cp), 2, files,
|
||||||
editor_argc, editor_argv, whitelist);
|
editor_argc, editor_argv, whitelist);
|
||||||
if (editor_path == NULL && errno != ENOENT)
|
if (editor_path != NULL)
|
||||||
|
break;
|
||||||
|
if (errno != ENOENT)
|
||||||
debug_return_str(NULL);
|
debug_return_str(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user