From ba82e75356b37ff7e248b984ca8484c9cd6d6141 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 25 Aug 2013 13:51:08 +0100 Subject: Clean environmnet harder --- NEWS | 8 +++++--- yarn | 10 +++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 2682b85..67d870f 100644 --- a/NEWS +++ b/NEWS @@ -7,9 +7,11 @@ Version 0.10, released UNRELEASED --------------------------------- * Yarn now cleans the environment when it runs shell commands for the - implementation steps. It also sets the `SRCDIR` environment variable - to point at the root of the source tree (the directory where yarn - was invoked from). + implementation steps. The PATH variable is kept from the user's + environment, every other variable is either removed or hardcoded to + a specific value. Additionally yarn sets the `SRCDIR` environment + variable to point at the root of the source tree (the directory + where yarn was invoked from). * A new option, `--timings`, has been added to yarn to report how long each scenario and each step took. diff --git a/yarn b/yarn index c13681b..3e9be0d 100755 --- a/yarn +++ b/yarn @@ -317,17 +317,17 @@ class YarnRunner(cliapp.Application): '''Return a clean environment for running tests.''' whitelisted = [ - 'TERM', - 'USER', - 'USERNAME', 'PATH', - 'HOME', - 'LOGNAME', ] hardcoded = { + 'TERM': 'dumb', 'SHELL': '/bin/sh', 'LC_ALL': 'C', + 'USER': 'tomjon', + 'USERNAME': 'tomjon', + 'LOGNAME': 'tomjon', + 'HOME': '/this/path/does/not/exist', } env = {} -- cgit v1.2.1