-
Notifications
You must be signed in to change notification settings - Fork 24
Ability to stop child process from Inheriting Handles #264
Copy link
Copy link
Closed
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)I-libs-api-nominatedIndicates that an issue has been nominated for discussion during a team meeting.Indicates that an issue has been nominated for discussion during a team meeting.T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Metadata
Metadata
Assignees
Labels
ACP-acceptedAPI Change Proposal is accepted (seconded with no objections)API Change Proposal is accepted (seconded with no objections)I-libs-api-nominatedIndicates that an issue has been nominated for discussion during a team meeting.Indicates that an issue has been nominated for discussion during a team meeting.T-libs-apiapi-change-proposalA proposal to add or alter unstable APIs in the standard librariesA proposal to add or alter unstable APIs in the standard libraries
Type
Fields
Give feedbackNo fields configured for issues without a type.
API Change Proposal
Problem Statement
Currently, there is no mechanism in the Rust standard library to create a child process on Windows that does not inherit handles from the calling process.
Motivating Examples or Use Cases
Handle inheritance can be problematic in multi-threaded programs, as different command-spawning actions may require passing different files to the child process. In addition, improving security by preventing the child process from acquiring certain handles is essential.
Disabling handle inheritance when unnecessary is important for several reasons:
Solution Sketch
To address this issue, we propose adding a new flag to the
CommandExttrait in Rust's standard library. This flag will determine whether the child process should inherit handles from the calling process.Additionally, the proposed change will affect the underlying
CreateProcessWfunction, as shown below:Alternatives
Links and Related Work
For further reference, please consult the following resources: