Skip to content

Commit 274653e

Browse files
senamakelmedullabot
andcommitted
feat(jail): add tinybox-jail, a per-process directory jail
Landlock (Linux), Seatbelt (macOS), AppContainer (Windows), a noop fallback and a persistent JailRegistry, moved from the OpenHuman host. A cwd jail confines one spawned Command to a directory tree, distinct from the box-level namespace isolation in tinybox-linux. The Landlock backend sits behind the `landlock` feature; the crate opts out of the workspace unsafe_code forbid because it is Win32 FFI and pre_exec. Co-authored-by: Medulla <medulla@tinyhumans.ai>
1 parent 9b13861 commit 274653e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎crates/tinybox-jail/src/windows.rs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
//! shipping. Win32 has many subtle wrong-trees you can bark up.
2929
3030
#![cfg(target_os = "windows")]
31+
// Written for edition 2021, where the body of an `unsafe fn` is an unsafe
32+
// context. Each fn documents its own safety contract; re-scoping them into
33+
// per-call blocks is a separate, hardware-tested change.
34+
#![allow(unsafe_op_in_unsafe_fn)]
3135

3236
use std::ffi::OsStr;
3337
use std::io;
@@ -100,9 +104,12 @@ use windows_sys::Win32::System::Threading::{
100104

101105
use super::jail::{Jail, JailBackend};
102106

107+
/// Windows AppContainer backend.
108+
#[derive(Debug)]
103109
pub struct AppContainerBackend;
104110

105111
impl AppContainerBackend {
112+
/// Creates the backend.
106113
pub fn new() -> Self {
107114
Self
108115
}

0 commit comments

Comments
 (0)