-
Couldn't load subscription status.
- Fork 13.9k
Add std::os::unix::process::CommandExt::chroot to safely chroot a child process
#137759
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
Conversation
|
rustbot has assigned @workingjubilee. Use |
|
☔ The latest upstream changes (presumably #136929) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
|
Will rebase shortly. |
…hild process This adds a `chroot` method to the `CommandExt` extension trait for the `Command` builder, to set a directory to chroot into. This will chroot the child process into that directory right before calling chdir for the `Command`'s working directory. To avoid allowing a process to have a working directory outside of the chroot, if the `Command` does not yet have a working directory set, `chroot` will set its working directory to "/".
e6dcf3a to
17fdf19
Compare
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
Sigh. This is the kind of thing that makes me hesitate to try to use links in doc comments. |
Add `std::os::unix::process::CommandExt::chroot` to safely chroot a child process This adds a `chroot` method to the `CommandExt` extension trait for the `Command` builder, to set a directory to chroot into. This will chroot the child process into that directory right before calling chdir for the `Command`'s working directory. To avoid allowing a process to have a working directory outside of the chroot, if the `Command` does not yet have a working directory set, `chroot` will set its working directory to "/". --- ACP: rust-lang/libs-team#551 This PR currently has the tracking issue set to "none"; if the ACP is approved, I'll file a tracking issue and update the PR.
|
@bors r- |
Link `Command::current_dir`. Co-authored-by: Amanieu d'Antras <[email protected]>
33d3376 to
348c1b0
Compare
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@bors r=Amanieu |
|
@bors rollup |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#137759 (Add `std::os::unix::process::CommandExt::chroot` to safely chroot a child process) - rust-lang#140994 (replace `cc_detect::cc2ar` with `cc::try_get_archiver`) - rust-lang#141213 (Suggest use "{}", self.x instead of {self.x} when resolve x as field of `self`) - rust-lang#141283 (Allow `x perf` to find rustc.exe on Windows) - rust-lang#141284 (Allow trailing comma after argument in query definition) - rust-lang#141317 (typeck: catch `continue`s pointing to blocks) - rust-lang#141318 (Avoid creating an empty identifer in `Symbol::to_ident_string`.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#137759 - joshtriplett:command-chroot, r=Amanieu Add `std::os::unix::process::CommandExt::chroot` to safely chroot a child process This adds a `chroot` method to the `CommandExt` extension trait for the `Command` builder, to set a directory to chroot into. This will chroot the child process into that directory right before calling chdir for the `Command`'s working directory. To avoid allowing a process to have a working directory outside of the chroot, if the `Command` does not yet have a working directory set, `chroot` will set its working directory to "/". --- ACP: rust-lang/libs-team#551 This PR currently has the tracking issue set to "none"; if the ACP is approved, I'll file a tracking issue and update the PR.
…nieu Add `std::os::unix::process::CommandExt::chroot` to safely chroot a child process This adds a `chroot` method to the `CommandExt` extension trait for the `Command` builder, to set a directory to chroot into. This will chroot the child process into that directory right before calling chdir for the `Command`'s working directory. To avoid allowing a process to have a working directory outside of the chroot, if the `Command` does not yet have a working directory set, `chroot` will set its working directory to "/". --- ACP: rust-lang/libs-team#551 This PR currently has the tracking issue set to "none"; if the ACP is approved, I'll file a tracking issue and update the PR.
This adds a
chrootmethod to theCommandExtextension trait for theCommandbuilder, to set a directory to chroot into. This will chrootthe child process into that directory right before calling chdir for the
Command's working directory.To avoid allowing a process to have a working directory outside of the
chroot, if the
Commanddoes not yet have a working directory set,chrootwill set its working directory to "/".ACP: rust-lang/libs-team#551
This PR currently has the tracking issue set to "none"; if the ACP is approved,
I'll file a tracking issue and update the PR.