-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syscall: add SysProcAttr.NoInheritHandles on Windows #42098
Comments
A bit of background to this CL Currently, CreateProcess/CreateProcessAsUser is called with bInheritHandles set to true. In my use case on Windows, I have a service running in session 0 that spawns a process in another session. As per the documentation here: "Terminal Services: You cannot inherit handles across sessions. Additionally, if this parameter is TRUE, you must create the process in the same session as the caller." |
We don't have any fields beginning with Dont, which is a bit difficult because of the missing apostrophe, among other things. With NoInheritHandles, this seems fine to me. |
Does anyone object to this change? |
Thanks @rsc I've updated the CL to rename DontInheritHandles->NoInheritHandles |
Change https://golang.org/cl/261917 mentions this issue: |
DontInheritHandles->NoInheritHandles SGTM. Thank you. Alex |
Based on the discussion above, this seems like a likely accept. |
No change in consensus, so accepted. |
@rsc does that mean we can submit https://go-review.googlesource.com/c/go/+/261917/ ? Thank you. Alex |
Yes. |
This is a proposal for the API change in the existing CL https://golang.org/cl/261917.
The proposal is to add a new field
DontInheritHandles
tosyscall.SysProcAttr
on Windows. Setting this field will cause handles to not be inherited when creating a child process.The negative field name is unfortunate but it's hard to see how to avoid it while preserving the desired semantics of the zero value of
SysProcAttr
.The text was updated successfully, but these errors were encountered: