Commit 55ab261 1 parent dce3677 commit 55ab261 Copy full SHA for 55ab261
File tree 3 files changed +25
-10
lines changed
3 files changed +25
-10
lines changed Original file line number Diff line number Diff line change 1
- # Leucite
1
+ <!-- Readme generated with `cargo-readme`: https://github.com/webern/cargo-readme -->
2
2
3
- A wrapper crate around [ ` rust-landlock ` ] ( https://docs.rs/landlock ) that
4
- provides useful abstractions and utilities
3
+ # leucite
5
4
6
- ## Example
5
+ [ ![ Crates.io] ( https://img.shields.io/crates/v/leucite.svg )] ( https://crates.io/crates/leucite )
6
+ [ ![ Documentation] ( https://docs.rs/leucite/badge.svg )] ( https://docs.rs/leucite/ )
7
+ [ ![ Dependency status] ( https://deps.rs/repo/github/basalt-rs/leucite/status.svg )] ( https://deps.rs/repo/github/basalt-rs/leucite )
8
+
9
+ A wrapper crate around [ ` rust-landlock ` ] ( https://docs.rs/landlock ) that provides useful
10
+ abstractions and utilities
11
+
12
+ ### Example
7
13
8
14
``` rust
9
15
let rules = Rules :: new ()
@@ -13,11 +19,13 @@ let rules = Rules::new()
13
19
. add_read_only (" /bin" )
14
20
. add_read_write (" /tmp/foo" );
15
21
16
- let mut child = Command :: new (" bash" )
22
+ // Execute `bash -i` in the `/tmp/foo` directory using the provided rules
23
+ Command :: new (" bash" )
17
24
. arg (" -i" )
18
25
. current_dir (" /tmp/foo" )
19
26
. env_clear ()
20
- . spawn_restricted (rules )? ;
21
-
22
- child . wait ()? ;
27
+ . restrict (rules . into ())
28
+ . max_memory (MemorySize :: from_mb (100 ))
29
+ . spawn ()?
30
+ . wait ()? ;
23
31
```
Original file line number Diff line number Diff line change
1
+ <!-- Readme generated with `cargo-readme`: https://github.com/webern/cargo-readme -->
2
+
3
+ # { {crate} }
4
+
5
+ [](https://crates.io/crates/leucite)
6
+ [](https://docs.rs/leucite/)
7
+ [](https://deps.rs/repo/github/basalt-rs/leucite)
8
+
9
+ { {readme} }
Original file line number Diff line number Diff line change 1
- //! # Leucite
2
- //!
3
1
//! A wrapper crate around [`rust-landlock`](https://docs.rs/landlock) that provides useful
4
2
//! abstractions and utilities
5
3
//!
You can’t perform that action at this time.
0 commit comments