kill process by session, and add timeout (#2608)

This commit is contained in:
Aiden McClelland
2024-04-23 14:01:40 -06:00
committed by GitHub
parent 7b8a0114f5
commit 3a5ee4a296
6 changed files with 191 additions and 85 deletions

View File

@@ -539,6 +539,7 @@ fn chroot(
cmd.env(k, v);
}
}
nix::unistd::setsid().with_kind(ErrorKind::Lxc)?; // TODO: error code
std::os::unix::fs::chroot(path)?;
if let Some(uid) = user.as_deref().and_then(|u| u.parse::<u32>().ok()) {
cmd.uid(uid);