Skip to content

Commit

Permalink
Allow compilation on other Linux architectures
Browse files Browse the repository at this point in the history
This patch simply removes the use of seccomp on unsupported
architectures. That should allow compilation and usage with slightly
reduced security, but I have not tested on any of these architectures.
  • Loading branch information
kylewillmon committed Nov 12, 2024
1 parent 1f2cbce commit e8d953b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ use rustix::process::{Gid, Pid, Uid, WaitOptions};

use crate::error::{Error, Result};
use crate::linux::namespaces::{MountAttrFlags, Namespaces};
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
use crate::linux::seccomp::SyscallFilter;
use crate::{Child, Command, Exception, Sandbox};

mod namespaces;
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
mod seccomp;

/// Linux sandboxing.
Expand Down Expand Up @@ -206,6 +208,7 @@ fn sandbox_init_inner(mut init_arg: ProcessInitArg) -> io::Result<libc::c_int> {
)?;

// Setup system call filters.
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
SyscallFilter::apply().map_err(|err| IoError::new(IoErrorKind::Other, err))?;

// Block suid/sgid.
Expand Down

0 comments on commit e8d953b

Please sign in to comment.