From aa49a21e54ce777efb5355ece2f6f01820f765ac Mon Sep 17 00:00:00 2001 From: Sergio Zharinov <zharinov@users.noreply.github.com> Date: Wed, 29 Jan 2020 09:29:53 +0400 Subject: [PATCH] fix(exec): Whitelist LC_ALL and LANG (#5239) --- lib/util/exec/env.ts | 2 ++ test/execUtil.ts | 2 ++ .../__snapshots__/artifacts.spec.ts.snap | 10 +++++++ .../__snapshots__/artifacts.spec.ts.snap | 6 +++++ .../__snapshots__/artifacts.spec.ts.snap | 12 +++++++++ .../__snapshots__/artifacts.spec.ts.snap | 14 ++++++++++ .../gradle/__snapshots__/index.spec.ts.snap | 26 +++++++++++++++++++ .../mix/__snapshots__/artifacts.spec.ts.snap | 4 +++ .../__snapshots__/extract.spec.ts.snap | 6 +++++ .../__snapshots__/index.spec.ts.snap | 24 +++++++++++++++++ .../__snapshots__/artifacts.spec.ts.snap | 6 +++++ .../__snapshots__/artifacts.spec.ts.snap | 6 +++++ test/util/env.spec.ts | 10 +++++-- test/util/exec.spec.ts | 2 ++ .../__snapshots__/lerna.spec.ts.snap | 8 ++++++ .../lock-files/__snapshots__/npm.spec.ts.snap | 4 +++ .../__snapshots__/pnpm.spec.ts.snap | 12 +++++++++ .../__snapshots__/yarn.spec.ts.snap | 22 ++++++++++++++++ 18 files changed, 174 insertions(+), 2 deletions(-) diff --git a/lib/util/exec/env.ts b/lib/util/exec/env.ts index 27a2a61837..55b557c1fc 100644 --- a/lib/util/exec/env.ts +++ b/lib/util/exec/env.ts @@ -4,6 +4,8 @@ const basicEnvVars = [ 'NO_PROXY', 'HOME', 'PATH', + 'LC_ALL', + 'LANG', 'DOCKER_HOST', ]; diff --git a/test/execUtil.ts b/test/execUtil.ts index 4277fe3075..d583c2c3f8 100644 --- a/test/execUtil.ts +++ b/test/execUtil.ts @@ -71,6 +71,8 @@ const basicEnvMock = { NO_PROXY: 'localhost', HOME: '/home/user', PATH: '/tmp/path', + LANG: 'en_US.UTF-8', + LC_ALL: 'en_US', }; const fullEnvMock = { diff --git a/test/manager/bundler/__snapshots__/artifacts.spec.ts.snap b/test/manager/bundler/__snapshots__/artifacts.spec.ts.snap index 5b255c6b07..9ba7eff927 100644 --- a/test/manager/bundler/__snapshots__/artifacts.spec.ts.snap +++ b/test/manager/bundler/__snapshots__/artifacts.spec.ts.snap @@ -22,6 +22,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -52,6 +54,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -73,6 +77,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -103,6 +109,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -133,6 +141,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/manager/cargo/__snapshots__/artifacts.spec.ts.snap b/test/manager/cargo/__snapshots__/artifacts.spec.ts.snap index 03acfd5977..8d17352b12 100644 --- a/test/manager/cargo/__snapshots__/artifacts.spec.ts.snap +++ b/test/manager/cargo/__snapshots__/artifacts.spec.ts.snap @@ -22,6 +22,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -41,6 +43,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -66,6 +70,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/manager/composer/__snapshots__/artifacts.spec.ts.snap b/test/manager/composer/__snapshots__/artifacts.spec.ts.snap index 2a25850fe4..ac5d76a351 100644 --- a/test/manager/composer/__snapshots__/artifacts.spec.ts.snap +++ b/test/manager/composer/__snapshots__/artifacts.spec.ts.snap @@ -34,6 +34,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -54,6 +56,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -74,6 +78,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -100,6 +106,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -120,6 +128,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -140,6 +150,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/manager/gomod/__snapshots__/artifacts.spec.ts.snap b/test/manager/gomod/__snapshots__/artifacts.spec.ts.snap index 972d4c7bb3..d524642ff1 100644 --- a/test/manager/gomod/__snapshots__/artifacts.spec.ts.snap +++ b/test/manager/gomod/__snapshots__/artifacts.spec.ts.snap @@ -27,6 +27,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -47,6 +49,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -67,6 +71,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -87,6 +93,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -102,6 +110,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -122,6 +132,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -142,6 +154,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/manager/gradle/__snapshots__/index.spec.ts.snap b/test/manager/gradle/__snapshots__/index.spec.ts.snap index 842f975d00..06f1e8de21 100644 --- a/test/manager/gradle/__snapshots__/index.spec.ts.snap +++ b/test/manager/gradle/__snapshots__/index.spec.ts.snap @@ -11,6 +11,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -31,6 +33,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -51,6 +55,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -71,6 +77,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -91,6 +99,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -234,6 +244,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -318,6 +330,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -461,6 +475,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -483,6 +499,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -505,6 +523,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -525,6 +545,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -545,6 +567,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -606,6 +630,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/manager/mix/__snapshots__/artifacts.spec.ts.snap b/test/manager/mix/__snapshots__/artifacts.spec.ts.snap index 4931cc2816..e2d8cc87e0 100644 --- a/test/manager/mix/__snapshots__/artifacts.spec.ts.snap +++ b/test/manager/mix/__snapshots__/artifacts.spec.ts.snap @@ -22,6 +22,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -52,6 +54,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/manager/pip_setup/__snapshots__/extract.spec.ts.snap b/test/manager/pip_setup/__snapshots__/extract.spec.ts.snap index ebbda780f2..9cba163ce7 100644 --- a/test/manager/pip_setup/__snapshots__/extract.spec.ts.snap +++ b/test/manager/pip_setup/__snapshots__/extract.spec.ts.snap @@ -13,6 +13,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -27,6 +29,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -41,6 +45,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/manager/pip_setup/__snapshots__/index.spec.ts.snap b/test/manager/pip_setup/__snapshots__/index.spec.ts.snap index ba761234a8..b49b25d685 100644 --- a/test/manager/pip_setup/__snapshots__/index.spec.ts.snap +++ b/test/manager/pip_setup/__snapshots__/index.spec.ts.snap @@ -11,6 +11,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -25,6 +27,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -39,6 +43,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -53,6 +59,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -329,6 +337,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -343,6 +353,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -357,6 +369,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -371,6 +385,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -391,6 +407,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -405,6 +423,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -419,6 +439,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -433,6 +455,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/manager/pipenv/__snapshots__/artifacts.spec.ts.snap b/test/manager/pipenv/__snapshots__/artifacts.spec.ts.snap index a03c90d07b..32d9421f5a 100644 --- a/test/manager/pipenv/__snapshots__/artifacts.spec.ts.snap +++ b/test/manager/pipenv/__snapshots__/artifacts.spec.ts.snap @@ -22,6 +22,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", "PIPENV_CACHE_DIR": "/tmp/renovate/cache/others/pipenv", @@ -42,6 +44,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", "PIPENV_CACHE_DIR": "/tmp/renovate/cache/others/pipenv", @@ -62,6 +66,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", "PIPENV_CACHE_DIR": "/tmp/renovate/cache/others/pipenv", diff --git a/test/manager/poetry/__snapshots__/artifacts.spec.ts.snap b/test/manager/poetry/__snapshots__/artifacts.spec.ts.snap index 3ff6e9a74e..4bedb2d680 100644 --- a/test/manager/poetry/__snapshots__/artifacts.spec.ts.snap +++ b/test/manager/poetry/__snapshots__/artifacts.spec.ts.snap @@ -23,6 +23,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -42,6 +44,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -67,6 +71,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/util/env.spec.ts b/test/util/env.spec.ts index d9ae4710b5..6bba70d2c3 100644 --- a/test/util/env.spec.ts +++ b/test/util/env.spec.ts @@ -7,6 +7,8 @@ describe('getChildProcess environment when trustlevel set to low', () => { 'NO_PROXY', 'HOME', 'PATH', + 'LC_ALL', + 'LANG', 'DOCKER_HOST', ]; beforeEach(() => { @@ -24,6 +26,8 @@ describe('getChildProcess environment when trustlevel set to low', () => { "HOME": "HOME", "HTTPS_PROXY": "HTTPS_PROXY", "HTTP_PROXY": "HTTP_PROXY", + "LANG": "LANG", + "LC_ALL": "LC_ALL", "NO_PROXY": "NO_PROXY", "PATH": "PATH", } @@ -34,14 +38,16 @@ describe('getChildProcess environment when trustlevel set to low', () => { expect(getChildProcessEnv()).not.toHaveProperty('PATH'); }); it('returns custom environment variables if passed and defined', () => { - process.env.LANG = 'LANG'; - expect(getChildProcessEnv(['LANG'])).toMatchInlineSnapshot(` + process.env.FOOBAR = 'FOOBAR'; + expect(getChildProcessEnv(['FOOBAR'])).toMatchInlineSnapshot(` Object { "DOCKER_HOST": "DOCKER_HOST", + "FOOBAR": "FOOBAR", "HOME": "HOME", "HTTPS_PROXY": "HTTPS_PROXY", "HTTP_PROXY": "HTTP_PROXY", "LANG": "LANG", + "LC_ALL": "LC_ALL", "NO_PROXY": "NO_PROXY", "PATH": "PATH", } diff --git a/test/util/exec.spec.ts b/test/util/exec.spec.ts index 14f8a0f69e..dc38a1b55c 100644 --- a/test/util/exec.spec.ts +++ b/test/util/exec.spec.ts @@ -378,6 +378,8 @@ describe(`Child process execution wrapper`, () => { }); it('Supports image prefetch', async () => { + process.env = processEnv; + const actualCmd: string[] = []; cpExec.mockImplementation((execCmd, execOpts, callback) => { actualCmd.push(execCmd); diff --git a/test/workers/branch/lock-files/__snapshots__/lerna.spec.ts.snap b/test/workers/branch/lock-files/__snapshots__/lerna.spec.ts.snap index 74584ecbcc..b44886867e 100644 --- a/test/workers/branch/lock-files/__snapshots__/lerna.spec.ts.snap +++ b/test/workers/branch/lock-files/__snapshots__/lerna.spec.ts.snap @@ -11,6 +11,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -30,6 +32,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -49,6 +53,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -68,6 +74,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/workers/branch/lock-files/__snapshots__/npm.spec.ts.snap b/test/workers/branch/lock-files/__snapshots__/npm.spec.ts.snap index fdec78de8a..9e790124ba 100644 --- a/test/workers/branch/lock-files/__snapshots__/npm.spec.ts.snap +++ b/test/workers/branch/lock-files/__snapshots__/npm.spec.ts.snap @@ -17,6 +17,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -38,6 +40,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/workers/branch/lock-files/__snapshots__/pnpm.spec.ts.snap b/test/workers/branch/lock-files/__snapshots__/pnpm.spec.ts.snap index 269ea2bbeb..ba66c47808 100644 --- a/test/workers/branch/lock-files/__snapshots__/pnpm.spec.ts.snap +++ b/test/workers/branch/lock-files/__snapshots__/pnpm.spec.ts.snap @@ -11,6 +11,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -30,6 +32,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -49,6 +53,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -68,6 +74,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -87,6 +95,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -106,6 +116,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, diff --git a/test/workers/branch/lock-files/__snapshots__/yarn.spec.ts.snap b/test/workers/branch/lock-files/__snapshots__/yarn.spec.ts.snap index 67fe97aeed..b497dc1c6f 100644 --- a/test/workers/branch/lock-files/__snapshots__/yarn.spec.ts.snap +++ b/test/workers/branch/lock-files/__snapshots__/yarn.spec.ts.snap @@ -11,6 +11,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -30,6 +32,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -44,6 +48,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -63,6 +69,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -82,6 +90,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -101,6 +111,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -115,6 +127,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -129,6 +143,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -148,6 +164,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -162,6 +180,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, @@ -181,6 +201,8 @@ Array [ "HOME": "/home/user", "HTTPS_PROXY": "https://example.com", "HTTP_PROXY": "http://example.com", + "LANG": "en_US.UTF-8", + "LC_ALL": "en_US", "NO_PROXY": "localhost", "PATH": "/tmp/path", }, -- GitLab