2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

parse_args: an environment variable may not start with '='.

Also check VAR=val format in validate_env_vars() and add an error
message if insert_env_vars() fails.
This commit is contained in:
Todd C. Miller
2022-12-28 14:07:43 -07:00
parent c820599893
commit 8eabbf8fdd
3 changed files with 10 additions and 3 deletions

View File

@@ -794,8 +794,11 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
}
/* Insert user-specified environment variables. */
if (!insert_env_vars(sudo_user.env_vars))
if (!insert_env_vars(sudo_user.env_vars)) {
sudo_warnx("%s",
U_("error setting user-specified environment variables"));
goto done;
}
/* Note: must call audit before uid change. */
if (ISSET(sudo_mode, MODE_EDIT)) {