For sudoedit, run the editor with the user's original environment

as per the documentation (and as in sudo 1.7.x).  Bug #688
This commit is contained in:
Todd C. Miller
2015-03-16 20:19:24 -06:00
parent d8d6fae793
commit be4872f691
3 changed files with 36 additions and 14 deletions

View File

@@ -525,6 +525,9 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
safe_cmnd = find_editor(NewArgc - 1, NewArgv + 1, &edit_argc, &edit_argv);
if (safe_cmnd == NULL || audit_success(edit_argc, edit_argv) != 0)
goto bad;
/* We want to run the editor with the unmodified environment. */
env_swap_old();
} else {
if (audit_success(NewArgc, NewArgv) != 0)
goto bad;