]>
Commit | Line | Data |
---|---|---|
ae015d71 TW |
1 | /* |
2 | * SPDX-License-Identifier: GPL-2.0-or-later | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * Copyright (C) 2023 Thomas Weißschuh <thomas@t-8ch.de> | |
10 | */ | |
11 | ||
12 | #ifndef UTIL_LINUX_SETPRIV_LANDLOCK | |
13 | #define UTIL_LINUX_SETPRIV_LANDLOCK | |
14 | ||
15 | #ifdef HAVE_LINUX_LANDLOCK_H | |
16 | ||
17 | #include <stdint.h> | |
18 | ||
19 | #include "list.h" | |
20 | ||
21 | struct setpriv_landlock_opts { | |
22 | uint64_t access_fs; | |
23 | struct list_head rules; | |
24 | }; | |
25 | ||
26 | void do_landlock(const struct setpriv_landlock_opts *opts); | |
27 | void parse_landlock_access(struct setpriv_landlock_opts *opts, const char *str); | |
28 | void parse_landlock_rule(struct setpriv_landlock_opts *opts, const char *str); | |
29 | void init_landlock_opts(struct setpriv_landlock_opts *opts); | |
30 | void usage_setpriv(FILE *out); | |
31 | ||
32 | #else | |
33 | ||
34 | #include "c.h" | |
35 | #include "nls.h" | |
36 | ||
37 | struct setpriv_landlock_opts {}; | |
38 | ||
39 | static inline void do_landlock(const void *opts __attribute__((unused))) {} | |
40 | static inline void parse_landlock_access( | |
41 | void *opts __attribute__((unused)), | |
42 | const char *str __attribute__((unused))) | |
43 | { | |
44 | errx(EXIT_FAILURE, _("no support for landlock")); | |
45 | } | |
46 | #define parse_landlock_rule parse_landlock_access | |
47 | static inline void init_landlock_opts(void *opts __attribute__((unused))) {} | |
48 | static inline void usage_setpriv(FILE *out __attribute__((unused))) {} | |
49 | ||
50 | #endif /* HAVE_LINUX_LANDLOCK_H */ | |
51 | ||
52 | #endif |