Add std::os::unix::process::CommandExt::chroot to safely chroot a child process#137759
Merged
bors merged 4 commits intorust-lang:masterfrom May 21, 2025
Merged
Add std::os::unix::process::CommandExt::chroot to safely chroot a child process#137759bors merged 4 commits intorust-lang:masterfrom
std::os::unix::process::CommandExt::chroot to safely chroot a child process#137759bors merged 4 commits intorust-lang:masterfrom
Conversation
Collaborator
|
rustbot has assigned @workingjubilee. Use |
Collaborator
|
☔ The latest upstream changes (presumably #136929) made this pull request unmergeable. Please resolve the merge conflicts. |
tbu-
reviewed
Mar 31, 2025
This comment has been minimized.
This comment has been minimized.
4 tasks
Member
Author
|
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
Amanieu
reviewed
May 20, 2025
Member
|
@bors r+ |
Collaborator
This comment has been minimized.
This comment has been minimized.
Member
Author
|
Sigh. This is the kind of thing that makes me hesitate to try to use links in doc comments. |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 21, 2025
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.
Collaborator
Member
Author
|
@bors r- |
Link `Command::current_dir`. Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
33d3376 to
348c1b0
Compare
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Member
Author
|
@bors r=Amanieu |
Collaborator
Member
Author
|
@bors rollup |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 21, 2025
…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
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 21, 2025
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.
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
May 23, 2025
…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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.