commit 9c0dbd7

default  ·  2025-01-05 12:52:05 +0000 UTC
parent 6a08d52
Added some autodetection for Linux landlocking on older systems.
1 files changed,  +15, -4
+15, -4
 1@@ -1,17 +1,28 @@
 2+#include "xs.h"
 3+
 4+#include "snac.h"
 5+
 6+#ifdef __linux__
 7+#include <linux/version.h>
 8+
 9+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
10+#define WITHOUT_SANDBOX
11+#endif
12+#endif /* __linux__ */
13+
14+
15 #ifdef WITHOUT_SANDBOX
16 
17 void sbox_enter(const char *basedir)
18 {
19     /* nothing to do */
20     (void)basedir;
21+
22+    srv_debug(0, xs_fmt("Linux sandboxing disabled or unsupported"));
23 }
24 
25 #else /* WITHOUT_SANDBOX */
26 
27-#include "xs.h"
28-
29-#include "snac.h"
30-
31 #include <unistd.h>
32 
33 #if defined (__linux__)