diff options
| author | default <nobody@localhost> | 2025-01-05 13:52:05 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2025-01-05 13:52:05 +0100 |
| commit | 9c0dbd7ec301331980261e4ba391e5bc5e9b3381 (patch) | |
| tree | e7a413398379535d22f2f7f909622a5a40ced170 | |
| parent | 6a08d52edbabb19032d7a1975b51ac70f5b3257a (diff) | |
Added some autodetection for Linux landlocking on older systems.
| -rw-r--r-- | sandbox.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -1,17 +1,28 @@ +#include "xs.h" + +#include "snac.h" + +#ifdef __linux__ +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0) +#define WITHOUT_SANDBOX +#endif +#endif /* __linux__ */ + + #ifdef WITHOUT_SANDBOX void sbox_enter(const char *basedir) { /* nothing to do */ (void)basedir; + + srv_debug(0, xs_fmt("Linux sandboxing disabled or unsupported")); } #else /* WITHOUT_SANDBOX */ -#include "xs.h" - -#include "snac.h" - #include <unistd.h> #if defined (__linux__) |