-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow pipe syscalls in Pipes ruleset
- Loading branch information
1 parent
43552f0
commit 4430e79
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ pub mod time; | |
pub use time::Time; | ||
|
||
pub mod danger_zone; | ||
pub mod pipes; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//! Contains a [`RuleSet`] for allowing pipes | ||
|
||
use std::collections::HashMap; | ||
use syscalls::Sysno; | ||
use crate::{SeccompRule, RuleSet}; | ||
|
||
/// [`Pipes`] allows you to create anonymous pipes for inter-process communication via the `pipe` | ||
/// syscalls. | ||
pub struct Pipes; | ||
impl RuleSet for Pipes { | ||
fn simple_rules(&self) -> Vec<Sysno> { | ||
vec![Sysno::pipe, Sysno::pipe2] | ||
} | ||
|
||
fn conditional_rules(&self) -> HashMap<Sysno, Vec<SeccompRule>> { | ||
HashMap::new() | ||
} | ||
|
||
fn name(&self) -> &'static str { | ||
"Pipes" | ||
} | ||
} |