From 9c0dbd7ec301331980261e4ba391e5bc5e9b3381 Mon Sep 17 00:00:00 2001 From: default Date: Sun, 5 Jan 2025 13:52:05 +0100 Subject: Added some autodetection for Linux landlocking on older systems. --- sandbox.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'sandbox.c') diff --git a/sandbox.c b/sandbox.c index 4a49f07..0d82f58 100644 --- a/sandbox.c +++ b/sandbox.c @@ -1,17 +1,28 @@ +#include "xs.h" + +#include "snac.h" + +#ifdef __linux__ +#include + +#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 #if defined (__linux__) -- cgit v1.2.3