|
|
8712ef |
diff -up ./plugins/sudoers/editor.c.whitelist ./plugins/sudoers/editor.c
|
|
|
8712ef |
--- ./plugins/sudoers/editor.c.whitelist 2023-01-16 17:31:58.108335076 +0100
|
|
|
8712ef |
+++ ./plugins/sudoers/editor.c 2023-01-16 17:33:37.375547672 +0100
|
|
|
8712ef |
@@ -40,7 +40,7 @@
|
|
|
8712ef |
|
|
|
8712ef |
/*
|
|
|
8712ef |
* Search for the specified editor in the user's PATH, checking
|
|
|
8712ef |
- * the result against whitelist if non-NULL. An argument vector
|
|
|
8712ef |
+ * the result against allowlist if non-NULL. An argument vector
|
|
|
8712ef |
* suitable for execve() is allocated and stored in argv_out.
|
|
|
8712ef |
* If nfiles is non-zero, files[] is added to the end of argv_out.
|
|
|
8712ef |
*
|
|
|
8712ef |
@@ -50,7 +50,7 @@
|
|
|
8712ef |
*/
|
|
|
8712ef |
static char *
|
|
|
8712ef |
resolve_editor(const char *ed, size_t edlen, int nfiles, char **files,
|
|
|
8712ef |
- int *argc_out, char ***argv_out, char * const *whitelist)
|
|
|
8712ef |
+ int *argc_out, char ***argv_out, char * const *allowlist)
|
|
|
8712ef |
{
|
|
|
8712ef |
char **nargv, *editor, *editor_path = NULL;
|
|
|
8712ef |
const char *cp, *ep, *tmp;
|
|
|
8712ef |
@@ -74,7 +74,7 @@ resolve_editor(const char *ed, size_t ed
|
|
|
8712ef |
}
|
|
|
8712ef |
|
|
|
8712ef |
/* If we can't find the editor in the user's PATH, give up. */
|
|
|
8712ef |
- if (find_path(editor, &editor_path, &user_editor_sb, getenv("PATH"), 0, whitelist) != FOUND) {
|
|
|
8712ef |
+ if (find_path(editor, &editor_path, &user_editor_sb, getenv("PATH"), 0, allowlist) != FOUND) {
|
|
|
8712ef |
free(editor);
|
|
|
8712ef |
errno = ENOENT;
|
|
|
8712ef |
debug_return_str(NULL);
|
|
|
8712ef |
@@ -130,7 +130,7 @@ resolve_editor(const char *ed, size_t ed
|
|
|
8712ef |
*/
|
|
|
8712ef |
char *
|
|
|
8712ef |
find_editor(int nfiles, char **files, int *argc_out, char ***argv_out,
|
|
|
8712ef |
- char * const *whitelist, const char **env_editor, bool env_error)
|
|
|
8712ef |
+ char * const *allowlist, const char **env_editor, bool env_error)
|
|
|
8712ef |
{
|
|
|
8712ef |
char *ev[3], *editor_path = NULL;
|
|
|
8712ef |
unsigned int i;
|
|
|
8712ef |
@@ -149,7 +149,7 @@ find_editor(int nfiles, char **files, in
|
|
|
8712ef |
if (editor != NULL && *editor != '\0') {
|
|
|
8712ef |
*env_editor = editor;
|
|
|
8712ef |
editor_path = resolve_editor(editor, strlen(editor),
|
|
|
8712ef |
- nfiles, files, argc_out, argv_out, whitelist);
|
|
|
8712ef |
+ nfiles, files, argc_out, argv_out, allowlist);
|
|
|
8712ef |
if (editor_path != NULL)
|
|
|
8712ef |
break;
|
|
|
8712ef |
if (errno != ENOENT)
|
|
|
8712ef |
@@ -169,7 +169,7 @@ find_editor(int nfiles, char **files, in
|
|
|
8712ef |
for (cp = sudo_strsplit(def_editor, def_editor_end, ":", &ep);
|
|
|
8712ef |
cp != NULL; cp = sudo_strsplit(NULL, def_editor_end, ":", &ep)) {
|
|
|
8712ef |
editor_path = resolve_editor(cp, (size_t)(ep - cp), nfiles,
|
|
|
8712ef |
- files, argc_out, argv_out, whitelist);
|
|
|
8712ef |
+ files, argc_out, argv_out, allowlist);
|
|
|
8712ef |
if (editor_path != NULL)
|
|
|
8712ef |
break;
|
|
|
8712ef |
if (errno != ENOENT)
|