From: Todd C. Miller Date: Fri, 20 Nov 2015 16:55:18 +0000 (-0700) Subject: When preserving variables from the invoking user's environment, if X-Git-Tag: SUDO_1_8_16^2~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c0354730af98baf5944226d7c60c0f353536ee8;p=sudo When preserving variables from the invoking user's environment, if there are duplicates only keep the first instance. --- diff --git a/plugins/sudoers/env.c b/plugins/sudoers/env.c index 90652508a..de7283499 100644 --- a/plugins/sudoers/env.c +++ b/plugins/sudoers/env.c @@ -918,7 +918,7 @@ rebuild_env(void) if (keepit) { /* Preserve variable. */ - CHECK_PUTENV(*ep, false, false); + CHECK_PUTENV(*ep, true, false); env_update_didvar(*ep, &didvar); } } @@ -988,7 +988,7 @@ rebuild_env(void) SET(didvar, DID_PATH); else if (strncmp(*ep, "TERM=", 5) == 0) SET(didvar, DID_TERM); - CHECK_PUTENV(*ep, false, false); + CHECK_PUTENV(*ep, true, false); } } }