Repository navigation
Conversation
On Windows every jail request was refused. AppContainer can run work only
through the owned-process API (it cannot return a std::process::Child), so
default_backend() is "unsupported" there by design. But the module used
default_backend() for every jailed path, and native_jail::prepare refused
any non-Unix host outright.
- The native shell, StartJailedExec and stdio paths take
default_owned_backend(). Off Windows it picks the same backend as before
(only AppContainer overrides is_owned_available), so nothing changes there.
- prepare admits a backend that is owned-available instead of requiring
Unix plus is_available.
- StdioSession spawns through spawn_owned_captured_with and holds an
OwnedChild. Its pipes are converted back into std child pipes, so the
async plumbing is unchanged. ChildStatus now carries the signal, so a
signalled stdio child still reports StdioExit::Signal on Unix.
- JailStatus reports the owned backend and its owned availability.
What AppContainer cannot enforce stays refused, now with the reason in
the message (same error codes): a jail with allow_subprocess false
("cannot enforce subprocess"), require_process_isolation (it reports no
isolation), and read denials overlapping the root, a grant or a writable
grant (it cannot carve denials).
Closes tinyhumansai#22
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): Run Windows jails under AppContainer through the owned-process backend. Purpose (title and description): run Windows jails under AppContainer through the owned-process backend. Previously every Windows jail request was refused, because AppContainer can only run work through the owned-process API and cannot return a `std::process::Child`, while the module used `default_backend()` everywhere and `native_jail::prepare` refused any non-Unix host. The pull request routes every jailed path (native shell, `StartJailedExec`, stdio) through `default_owned_backend()`, admits backends that are owned-available in `prepare`, moves `StdioSession` onto `OwnedChild` with pipe conversion and `ChildStatus`-based signal reporting, reports the owned backend in `JailStatus`, adds signal plumbing to `ChildStatus`, and gives refusals specific reasons while keeping their error codes. It also adds cmd.exe verbatim `/C` argument handling in the Windows command-line builder, which the description does not call out. Off Windows the selected backend is unchanged. Latest push delta: unavailable — the review state has the prior reviewed head and rendered evidence but no trusted base-to-head diff comparison, so the whole pull-request diff above is not a push delta. Review snapshot
Completeness: Complete What changed15 files changed, 462 insertions, 62 deletions. Features
Tests
FindingsNo active actionable findings. Before mergeNone. How this fits togetherflowchart LR
n0["..._when_no_candidate_can_return_owned_child<br/>changed"]:::changed
n1["ChildStatus<br/>changed"]:::changed
n2["default_backend<br/>changed"]:::changed
n3["wait_for_child<br/>changed"]:::changed
n4["JailBackend"]:::impacted
n5["clone"]:::impacted
n6["spawn"]:::impacted
n7["io"]:::impacted
n8["prepare"]:::impacted
n0 -->|uses| n4
n2 -->|uses| n4
n2 -->|calls| n5
n3 -->|uses| n1
n3 -->|uses| n7
n4 -->|uses| n7
n6 -->|uses| n4
n6 -->|calls| n5
n8 -->|uses| n4
classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
# Conflicts: # crates/tinybox-module/src/tinybus_module/native_jail_tests.rs
…il status Under AppContainer the native shell's cmd invocation failed: the spawner re-quoted every argument by CommandLineToArgvW rules, so the script cmd was handed as an already-quoted raw argument reached it as \"script\" and ran as a program name. cmd takes everything after /C verbatim, so for cmd.exe those arguments now pass through unchanged. jail_status_reports_the_detected_backend_without_starting_a_process still compared against the legacy selection, which is "unsupported" on Windows; it now checks the owned backend jail_status reports.
Summary
On Windows every jail request was refused, so the AppContainer backend was never used. AppContainer can run work only through the owned-process API, because it can't hand back a
std::process::Child. Sodefault_backend()is "unsupported" on Windows by design. But the module useddefault_backend()for every jailed path, andnative_jail::preparerefused any non-Unix host outright.StartJailedExecand stdio paths takedefault_owned_backend(). Off Windows that picks the same backend as before: only AppContainer overridesis_owned_available. So nothing changes on Linux or macOS.prepareadmits a backend that is owned-available, instead of requiring Unix plusis_available.StdioSessionspawns throughspawn_owned_captured_withand holds anOwnedChild. Its pipes are converted back into standard child pipes, so the async plumbing is unchanged.ChildStatusnow carries the signal, so a signalled stdio child still reportsStdioExit::Signalon Unix.JailStatusreports the owned backend and its owned availability.What AppContainer can't enforce stays refused, now with the reason in the message. The error codes are unchanged:
allow_subprocess: false: "cannot enforce subprocess";require_process_isolation: AppContainer reports no isolation level;Related issue
Closes #22. This corrects our earlier comment there that this "looks done": the backend existed, but nothing selected it.
API or behavior changes
ChildStatus::signal()andChildStatus::with_signal()are new;from_codeis unchanged.Validation
cargo fmt --all -- --check: clean.cargo clippy --all-targets --all-features -- -D warnings: 0 errors, same as main.cargo build: ok.cargo test -p tinybox-jail -p tinybox-module -p tinybox-host: 617 passed, 0 failed, with no failures unique to this branch.stdiotests repeated 10 times: all passed.stdio.rs93.00%,native_jail.rs92.34%,tinybox-jail/src/jail.rs92.99% (gate 90%).is_availablegate failsa_backend_usable_only_through_the_owned_api_is_admitted("no native jail backend is available on this host");ChildStatusfailsan_owned_child_ended_by_a_signal_reports_the_signal.windows-latestjobs, includingrun_native_shell_runs_a_jailed_command_under_appcontainer_on_windowsandon_windows_the_owned_selection_is_appcontainer.Tests
off_windows_the_owned_selection_is_the_plain_selectionandon_windows_the_owned_selection_is_appcontainercheck backend selection on each side.ChildStatuscarries no signal from a code, and an owned child killed by SIGKILL reports signal 9 (Unix).allow_subprocess: falseis refused naming subprocess, for both enforcement modes;require_process_isolationis refused saying so;echothroughRunNativeShellunder AppContainer exits 0 with its output.Documentation
The module README's native-jail section, plus
default_owned_backendrustdoc.Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the description