util-linux/0001-setpriv-apply-landlock-without-configuration.patch
Colin Walters 1567a60b3a Backport 211a9da0b4
xref https://github.com/coreos/rpm-ostree/issues/4830

(cherry picked from commit 1d94d2966ad14311b3ad3c010f1116e81dc7ed42)
2024-02-16 13:56:28 +01:00

33 lines
912 B
Diff

From 211a9da0b4e9704eea210d7944b723fa78272c79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= <thomas@t-8ch.de>
Date: Wed, 31 Jan 2024 18:01:08 +0100
Subject: [PATCH] setpriv: apply landlock without configuration
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes #2746
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
---
sys-utils/setpriv-landlock.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys-utils/setpriv-landlock.c b/sys-utils/setpriv-landlock.c
index 153e748f6..00ad38c61 100644
--- a/sys-utils/setpriv-landlock.c
+++ b/sys-utils/setpriv-landlock.c
@@ -166,6 +166,9 @@ void do_landlock(const struct setpriv_landlock_opts *opts)
struct list_head *entry;
int fd, ret;
+ if (!opts->access_fs)
+ return;
+
const struct landlock_ruleset_attr ruleset_attr = {
.handled_access_fs = opts->access_fs,
};
--
2.41.0