1From 938c7df38eee723e8baa459c9457968fdd63c952 Mon Sep 17 00:00:00 2001
2From: Michael Forney <mforney@mforney.org>
3Date: Tue, 3 Mar 2026 15:06:24 -0800
4Subject: [PATCH] Make use of linux landlock conditional on syscall
5 availability
6
7This is also checked in the configure test, but to simplify building
8on oasis, just use the preprocessor.
9---
10 src/xz/sandbox.h | 4 ++++
11 1 file changed, 4 insertions(+)
12
13diff --git a/src/xz/sandbox.h b/src/xz/sandbox.h
14index 98b9862a..866b1478 100644
15--- a/src/xz/sandbox.h
16+++ b/src/xz/sandbox.h
17@@ -9,6 +9,10 @@
18 //
19 ///////////////////////////////////////////////////////////////////////////////
20
21+#if !defined(SYS_landlock_create_ruleset) || !defined(SYS_landlock_restrict_self)
22+# undef HAVE_LINUX_LANDLOCK
23+#endif
24+
25 #if defined(HAVE_PLEDGE) || defined(HAVE_LINUX_LANDLOCK) \
26 || defined(HAVE_CAP_RIGHTS_LIMIT)
27 # define ENABLE_SANDBOX 1
28--
292.49.0
30