Crate boxxy [−] [src]
This crate provides an interactive shell that can be used to provide a basic debugger for sandboxes. It features a couple of builtin commands to test eg. file access when external programs can't be used (chroots or seccomp).
It also accepts custom functions that can be included to step through various stages of your sandbox.
Example
extern crate boxxy; extern crate env_logger; fn stage1(args: Vec<String>) -> Result<(), boxxy::Error> { println!("init stage 1! {:?}", args); // your code here Ok(()) } fn stage2(args: Vec<String>) -> Result<(), boxxy::Error> { println!("init stage 2! {:?}", args); // your code here Ok(()) } fn main() { env_logger::init().unwrap(); let toolbox = boxxy::Toolbox::new().with(vec![ ("stage1", stage1), ("stage2", stage2), ]); boxxy::Shell::new(toolbox).run() }
Reexports
pub use shell::Shell; |
pub use shell::Toolbox; |
pub use shell::Command; |
pub use shell::NativeCommand; |
pub use shell::ForeignCommand; |
Modules
busybox |
Builtin commands. |
ffi |
Abstractions of some unsafe functions. |
shell |
The interactive shell. |
Enums
Error |
Possible errors during builtin commands |
Type Definitions
Arguments |
Arguments passed to builtin commands |
Result |
Result of builtin commands |