diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-04-28 17:48:09 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-04-29 17:27:36 -0300 |
commit | 62ac93a7b5adf4036695e8716d32758eed6eb180 (patch) | |
tree | 1b9e520011e038f88160516c2a263acc1242eb08 /src | |
parent | profiles: fix new game profiles (diff) | |
download | firejail-62ac93a7b5adf4036695e8716d32758eed6eb180.tar.gz firejail-62ac93a7b5adf4036695e8716d32758eed6eb180.tar.zst firejail-62ac93a7b5adf4036695e8716d32758eed6eb180.zip |
landlock: fix building without landlock.h
landlock.h may not be available on the system (such as with older
versions of Linux API headers), so only try to include it if
`HAVE_LANDLOCK` is defined.
This fixes the following error from `build_debian_package` (which uses
`debian:buster`) on GitLab CI[1]:
$ ./mkdeb.sh --enable-fatal-warnings
[...]
gcc [...] -c ../../src/firejail/landlock.c -o ../../src/firejail/landlock.o
../../src/firejail/landlock.c:22:10: fatal error: linux/landlock.h: No such file or directory
#include <linux/landlock.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
This amends commit a05ae97af ("landlock: amend empty functions and
comments", 2024-04-08) / PR #6305.
Relates to #6078.
[1] https://gitlab.com/Firejail/firejail_ci/-/jobs/6743161059
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/landlock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/firejail/landlock.c b/src/firejail/landlock.c index a360f155b..3ac1bddae 100644 --- a/src/firejail/landlock.c +++ b/src/firejail/landlock.c | |||
@@ -19,7 +19,6 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include "firejail.h" | 21 | #include "firejail.h" |
22 | #include <linux/landlock.h> | ||
23 | #include <sys/prctl.h> | 22 | #include <sys/prctl.h> |
24 | #include <sys/syscall.h> | 23 | #include <sys/syscall.h> |
25 | #include <sys/types.h> | 24 | #include <sys/types.h> |
@@ -28,6 +27,8 @@ | |||
28 | 27 | ||
29 | #ifdef HAVE_LANDLOCK | 28 | #ifdef HAVE_LANDLOCK |
30 | 29 | ||
30 | #include <linux/landlock.h> | ||
31 | |||
31 | static int ll_ruleset_fd = -1; | 32 | static int ll_ruleset_fd = -1; |
32 | static int ll_abi = -1; | 33 | static int ll_abi = -1; |
33 | 34 | ||