From 9f33ac46b2dfe2702fb5fef9b4dbdbcb692fc340 Mon Sep 17 00:00:00 2001 From: strNophix Date: Thu, 23 Jun 2022 16:16:16 +0200 Subject: [PATCH] Process isolation --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index e631f96..647aaa5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,6 +29,10 @@ fn main() { // ensure that directory changed to root of jail std::env::set_current_dir("/").expect("Failed to change to root dir"); + unsafe { + libc::unshare(libc::CLONE_NEWPID); + } + let output = std::process::Command::new(command) .args(command_args) .output()