]> granicus.if.org Git - sudo/commitdiff
When preserving variables from the invoking user's environment, if
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 20 Nov 2015 16:55:18 +0000 (09:55 -0700)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 20 Nov 2015 16:55:18 +0000 (09:55 -0700)
there are duplicates only keep the first instance.

plugins/sudoers/env.c

index 90652508a8d7b1def996bd4b688a97741959640c..de72834999c0e47c4fc08746885d835a0a8a5c66 100644 (file)
@@ -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);
            }
        }
     }