Add ability to contain a process in a scheme sandbox
This commit is contained in:
parent
6b8a576a21
commit
d294d56b52
16 changed files with 186 additions and 73 deletions
|
@ -1,13 +1,21 @@
|
|||
use collections::Vec;
|
||||
|
||||
use context;
|
||||
use scheme;
|
||||
use syscall::error::Result;
|
||||
use syscall::error::{Error, ESRCH, Result};
|
||||
|
||||
pub fn resource() -> Result<Vec<u8>> {
|
||||
let scheme_ns = {
|
||||
let contexts = context::contexts();
|
||||
let context_lock = contexts.current().ok_or(Error::new(ESRCH))?;
|
||||
let context = context_lock.read();
|
||||
context.scheme_ns
|
||||
};
|
||||
|
||||
let mut data = Vec::new();
|
||||
|
||||
let schemes = scheme::schemes();
|
||||
for (name, _scheme_lock) in schemes.iter_name() {
|
||||
for (name, _scheme_lock) in schemes.iter_name(scheme_ns) {
|
||||
data.extend_from_slice(name);
|
||||
data.push(b'\n');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue