diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2022-11-03 11:02:51 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2022-11-04 01:23:16 +0000 |
| commit | bc2dc2384619d871000f9627b5d4e2bdc1dd38dc (patch) | |
| tree | 5dbd19e59037b21c724fd8ee130481a87d7eff8b /src/os/exec/exec_test.go | |
| parent | c1c6b0ca79233c8b7612957291c2d47d337cc2de (diff) | |
| download | go-bc2dc2384619d871000f9627b5d4e2bdc1dd38dc.tar.xz | |
os/exec: allow NUL in environment variables on Plan 9
Plan 9 uses NUL as os.PathListSeparator, so it's almost always going
to appear in the environment variable list. Exempt GOOS=plan9 from the
check for NUL in environment variables.
For #56284.
Fixes #56544.
Change-Id: I23df233cdf20c0a9a606fd9253e15a9b5482575a
Reviewed-on: https://go-review.googlesource.com/c/go/+/447715
Reviewed-by: David du Colombier <0intro@gmail.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/os/exec/exec_test.go')
| -rw-r--r-- | src/os/exec/exec_test.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os/exec/exec_test.go b/src/os/exec/exec_test.go index 7f1f99330d..cb1545a651 100644 --- a/src/os/exec/exec_test.go +++ b/src/os/exec/exec_test.go @@ -1038,6 +1038,9 @@ func TestDedupEnvEcho(t *testing.T) { } func TestEnvNULCharacter(t *testing.T) { + if runtime.GOOS == "plan9" { + t.Skip("plan9 explicitly allows NUL in the enviroment") + } cmd := helperCommand(t, "echoenv", "FOO", "BAR") cmd.Env = append(cmd.Environ(), "FOO=foo\x00BAR=bar") out, err := cmd.CombinedOutput() |
