mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2026-01-04 00:20:43 +00:00
Proof-of-concept, default-permit seccomp-bpf sandbox
Can be disabled by adding -DCONFIG_NOSANDBOX to CXXFLAGS.
This commit is contained in:
21
src/sandbox/Sandbox.hpp
Normal file
21
src/sandbox/Sandbox.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
// use the sandbox on supported platforms, unless disabled
|
||||
#if defined(__linux__) || defined(__OpenBSD__)
|
||||
|
||||
# if !defined(CONFIG_NOSANDBOX)
|
||||
void sandbox_start();
|
||||
# else
|
||||
|
||||
#include <iostream>
|
||||
|
||||
inline void sandbox_start() {
|
||||
std::cout << "[WARN] Built without a sandbox" << std::endl;
|
||||
}
|
||||
|
||||
# endif // CONFIG_NOSANDBOX
|
||||
|
||||
#else
|
||||
// stub for unsupported platforms
|
||||
inline void sandbox_start() {}
|
||||
#endif
|
||||
Reference in New Issue
Block a user