Skip to content

[Windows] Way to make child processes inherits parent attributes? #67616

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

Closed
tesuji opened this issue Dec 25, 2019 · 7 comments
Closed

[Windows] Way to make child processes inherits parent attributes? #67616

tesuji opened this issue Dec 25, 2019 · 7 comments
Labels
A-process Area: `std::process` and `std::env` C-feature-request Category: A feature request, i.e: not implemented / a PR. O-windows Operating system: Windows T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@tesuji
Copy link
Contributor

tesuji commented Dec 25, 2019

Rust is using it internally: https://github.com/rust-lang/rust/search?q=security_attributes&unscoped_q=security_attributes
But rust doesn't expose that to public APIs.
That makes people fall into unsafe Rust with CreateFileW and CreateFile2.

@jonas-schievink jonas-schievink added C-feature-request Category: A feature request, i.e: not implemented / a PR. O-windows Operating system: Windows T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Dec 25, 2019
@tesuji tesuji changed the title [Windows] Way to set SECURITY_ATTRIBUTES for File? [Windows] Way to make child processes inhirits parent attributes? Apr 5, 2020
@tesuji tesuji changed the title [Windows] Way to make child processes inhirits parent attributes? [Windows] Way to make child processes inherits parent attributes? Apr 5, 2020
@tesuji
Copy link
Contributor Author

tesuji commented Apr 5, 2020

Current usecases:

@tesuji
Copy link
Contributor Author

tesuji commented Apr 5, 2020

I changed the feature request. Does this sound more plausible?
cc @repnop (oops, wrong guy) for Windows advices.

@tesuji
Copy link
Contributor Author

tesuji commented Apr 5, 2020

cc @retep998

@retep998
Copy link
Member

retep998 commented Apr 5, 2020

What you're proposing is adding the security_attributes method to the public API exposed through OpenOptionsExt on Windows? If so, what should the type signature look like?

@tesuji
Copy link
Contributor Author

tesuji commented Apr 7, 2020

adding the security_attributes method

Nope. I just want a way to make child processes inherits its parent attribute.

@retep998
Copy link
Member

retep998 commented Apr 7, 2020

Oh, you want to specify that a handle should be inherited by a child process. Marking the handle as inheritable is actually the wrong thing to do. The correct approach is to explicitly tell CreateProcess which handles we want to inherit: #38227 . Once that is implemented, we can add a windows specific CommandExt method to specify arbitrary handles to be inherited.

@workingjubilee workingjubilee added the A-process Area: `std::process` and `std::env` label Mar 19, 2023
@Dylan-DPC
Copy link
Member

Closing this as there is no clear path on what's being proposed and the issue has been stalled as well

@Dylan-DPC Dylan-DPC closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-process Area: `std::process` and `std::env` C-feature-request Category: A feature request, i.e: not implemented / a PR. O-windows Operating system: Windows T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants