summaryrefslogtreecommitdiffstats
path: root/sys-utils/setpriv-landlock.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
commit1272be04be0cb803eec87f602edb2e3e6f111aea (patch)
treebce17f6478cdd9f3c4ec3d751135dc42786d6a56 /sys-utils/setpriv-landlock.h
parentReleasing progress-linux version 2.39.3-11~progress7.99u1. (diff)
downloadutil-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.tar.xz
util-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.zip
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sys-utils/setpriv-landlock.h')
-rw-r--r--sys-utils/setpriv-landlock.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/sys-utils/setpriv-landlock.h b/sys-utils/setpriv-landlock.h
new file mode 100644
index 0000000..d66f86d
--- /dev/null
+++ b/sys-utils/setpriv-landlock.h
@@ -0,0 +1,52 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Copyright (C) 2023 Thomas Weißschuh <thomas@t-8ch.de>
+ */
+
+#ifndef UTIL_LINUX_SETPRIV_LANDLOCK
+#define UTIL_LINUX_SETPRIV_LANDLOCK
+
+#ifdef HAVE_LINUX_LANDLOCK_H
+
+#include <stdint.h>
+
+#include "list.h"
+
+struct setpriv_landlock_opts {
+ uint64_t access_fs;
+ struct list_head rules;
+};
+
+void do_landlock(const struct setpriv_landlock_opts *opts);
+void parse_landlock_access(struct setpriv_landlock_opts *opts, const char *str);
+void parse_landlock_rule(struct setpriv_landlock_opts *opts, const char *str);
+void init_landlock_opts(struct setpriv_landlock_opts *opts);
+void usage_setpriv(FILE *out);
+
+#else
+
+#include "c.h"
+#include "nls.h"
+
+struct setpriv_landlock_opts {};
+
+static inline void do_landlock(const void *opts __attribute__((unused))) {}
+static inline void parse_landlock_access(
+ void *opts __attribute__((unused)),
+ const char *str __attribute__((unused)))
+{
+ errx(EXIT_FAILURE, _("no support for landlock"));
+}
+#define parse_landlock_rule parse_landlock_access
+static inline void init_landlock_opts(void *opts __attribute__((unused))) {}
+static inline void usage_setpriv(FILE *out __attribute__((unused))) {}
+
+#endif /* HAVE_LINUX_LANDLOCK_H */
+
+#endif