]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.17] syscall: do not use handle lists on windows when NoInheritHan...
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 16 Sep 2021 22:11:19 +0000 (16:11 -0600)
committerDmitri Shuralyov <dmitshur@golang.org>
Mon, 25 Oct 2021 21:16:46 +0000 (21:16 +0000)
commit11b64b428b5fc07006b737de2b331382e64334a8
tree0f861c3d570dd144da529e177a279a75cab19f4d
parent2ac3bdf378ae408ad8c993084c1c6f7d05b7dff8
[release-branch.go1.17] syscall: do not use handle lists on windows when NoInheritHandles is true

If NoInheritHandles is passed, then we shouldn't attempt to do anything
with handle lists. Otherwise CreateProcess fails with invalid param,
because it's being told both to not inherit handles and to inherit
certain handles.

This commit fixes that by using the same logic for handle lists as it
does for enabling or disabling handle inheritance. It also adds a test
to make sure this doesn't regress again.

Updates #48040
Fixes #48075

Change-Id: I507261baeec263091738ab90157a991d917dc92f
Reviewed-on: https://go-review.googlesource.com/c/go/+/350416
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Patrik Nyblom <pnyb@google.com>
src/os/exec/exec_windows_test.go
src/syscall/exec_windows.go