Skip to content

Commit

Permalink
Fix oldstable build
Browse files Browse the repository at this point in the history
  • Loading branch information
cd-work committed Nov 28, 2023
1 parent 95c5142 commit e1f5143
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use std::collections::HashMap;
use std::ffi::CString;
use std::io::Error as IoError;
use std::io::{Error as IoError, ErrorKind as IoErrorKind};
use std::os::unix::ffi::OsStrExt;
use std::os::unix::process::CommandExt;
use std::path::{Component, Path, PathBuf};
Expand Down Expand Up @@ -77,6 +77,10 @@ impl Sandbox for LinuxSandbox {
sandboxee.pre_exec(move || post_fork(uid, gid, self.allow_networking)).spawn()?
};

// TODO
// Drop root user mapping for the parent process.
// namespaces::create_user_namespace(uid, gid, Namespaces::empty()).unwrap();

Ok(child)
}
}
Expand All @@ -101,7 +105,7 @@ fn post_fork(uid: u32, gid: u32, allow_networking: bool) -> io::Result<()> {
namespaces::create_user_namespace(uid, gid, Namespaces::empty())?;

// Setup system call filters.
SyscallFilter::apply().map_err(io::Error::other)?;
SyscallFilter::apply().map_err(|err| IoError::new(IoErrorKind::Other, err))?;

// Block suid/sgid.
//
Expand Down

0 comments on commit e1f5143

Please sign in to comment.