aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2023-06-23 12:44:15 +0200
committerQuim Muntal <quimmuntal@gmail.com>2023-06-27 16:16:24 +0000
commit8008c0840ff09c492434e67de443ee478957fb8f (patch)
treed9e208f6db98e8d0e6ba15c6ee22251f80782baa
parent13529cc5f443ef4e242da3716daa0032aa8d34f2 (diff)
downloadgo-8008c0840ff09c492434e67de443ee478957fb8f.tar.gz
go-8008c0840ff09c492434e67de443ee478957fb8f.zip
syscall: clarify which handles are affected by SysProcAttr.NoInheritHandles
SysProcAttr.NoInheritHandles doc comment is not clear about which handles are affected by it. This CL clarifies that it not only affects the ones passed in AdditionalInheritedHandles, but also the ones passed in ProcAttr.Files, which are required to be stderr, stdin and stdout when calling syscall.StartProcess. Updates #60942 Change-Id: I5bc5b3604b6db04b83f6764d5c5ffbdafeeb22fb Reviewed-on: https://go-review.googlesource.com/c/go/+/505515 Run-TryBot: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
-rw-r--r--src/syscall/exec_windows.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/syscall/exec_windows.go b/src/syscall/exec_windows.go
index 45295dedff..0a93bc0a80 100644
--- a/src/syscall/exec_windows.go
+++ b/src/syscall/exec_windows.go
@@ -247,7 +247,7 @@ type SysProcAttr struct {
Token Token // if set, runs new process in the security context represented by the token
ProcessAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the new process
ThreadAttributes *SecurityAttributes // if set, applies these security attributes as the descriptor for the main thread of the new process
- NoInheritHandles bool // if set, each inheritable handle in the calling process is not inherited by the new process
+ NoInheritHandles bool // if set, no handles are inherited by the new process, not even the standard handles, contained in ProcAttr.Files, nor the ones contained in AdditionalInheritedHandles
AdditionalInheritedHandles []Handle // a list of additional handles, already marked as inheritable, that will be inherited by the new process
ParentProcess Handle // if non-zero, the new process regards the process given by this handle as its parent process, and AdditionalInheritedHandles, if set, should exist in this parent process
}