summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2025-01-05 13:52:05 +0100
committerGravatar default2025-01-05 13:52:05 +0100
commit9c0dbd7ec301331980261e4ba391e5bc5e9b3381 (patch)
treee7a413398379535d22f2f7f909622a5a40ced170
parentUpdated README. (diff)
downloadpenes-snac2-9c0dbd7ec301331980261e4ba391e5bc5e9b3381.tar.gz
penes-snac2-9c0dbd7ec301331980261e4ba391e5bc5e9b3381.tar.xz
penes-snac2-9c0dbd7ec301331980261e4ba391e5bc5e9b3381.zip
Added some autodetection for Linux landlocking on older systems.
-rw-r--r--sandbox.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sandbox.c b/sandbox.c
index 4a49f07..0d82f58 100644
--- a/sandbox.c
+++ b/sandbox.c
@@ -1,17 +1,28 @@
1#include "xs.h"
2
3#include "snac.h"
4
5#ifdef __linux__
6#include <linux/version.h>
7
8#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0)
9#define WITHOUT_SANDBOX
10#endif
11#endif /* __linux__ */
12
13
1#ifdef WITHOUT_SANDBOX 14#ifdef WITHOUT_SANDBOX
2 15
3void sbox_enter(const char *basedir) 16void sbox_enter(const char *basedir)
4{ 17{
5 /* nothing to do */ 18 /* nothing to do */
6 (void)basedir; 19 (void)basedir;
20
21 srv_debug(0, xs_fmt("Linux sandboxing disabled or unsupported"));
7} 22}
8 23
9#else /* WITHOUT_SANDBOX */ 24#else /* WITHOUT_SANDBOX */
10 25
11#include "xs.h"
12
13#include "snac.h"
14
15#include <unistd.h> 26#include <unistd.h>
16 27
17#if defined (__linux__) 28#if defined (__linux__)