summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-08-21 18:48:19 +0200
committerLennart Poettering <lennart@poettering.net>2023-08-21 18:50:29 +0200
commite2fc0a72223bf1b4b1e2de9e9aa8169ec93ef8f9 (patch)
tree34ae54440c90a9ee787640f523ab7b2e56aad33f
parentseccomp: move seccomp_parse_errno_or_action() into common definitions (diff)
downloadsystemd-e2fc0a72223bf1b4b1e2de9e9aa8169ec93ef8f9.tar.xz
systemd-e2fc0a72223bf1b4b1e2de9e9aa8169ec93ef8f9.zip
tree-wide: don't ifdef seccomp-util.h, drop seccomp.h inclusion everywhere
seccomp-util.h doesn't need ifdeffing, hence don't. It has worked since quite a while with HAVE_SECCOMP is off, hence use it everywhere. Also drop explicit seccomp.h inclusion everywhere (which needs HAVE_SECCOMP ifdeffery everywhere). seccomp-util.h includes it anyway, automatically, which we can just rely on, and it deals with HAVE_SECCOMP at one central place.
-rw-r--r--src/analyze/analyze-security.c4
-rw-r--r--src/core/dbus-execute.c7
-rw-r--r--src/core/execute.c6
-rw-r--r--src/core/load-fragment.c5
-rw-r--r--src/core/main.c5
-rw-r--r--src/nspawn/nspawn-oci.c5
-rw-r--r--src/nspawn/nspawn-seccomp.c6
-rw-r--r--src/nspawn/nspawn-settings.h5
-rw-r--r--src/nspawn/nspawn.c2
-rw-r--r--src/shared/bus-unit-util.c2
-rw-r--r--src/test/test-execute.c2
11 files changed, 2 insertions, 47 deletions
diff --git a/src/analyze/analyze-security.c b/src/analyze/analyze-security.c
index 5408cfdeaa..fb743a895f 100644
--- a/src/analyze/analyze-security.c
+++ b/src/analyze/analyze-security.c
@@ -27,9 +27,7 @@
#include "parse-util.h"
#include "path-util.h"
#include "pretty-print.h"
-#if HAVE_SECCOMP
-# include "seccomp-util.h"
-#endif
+#include "seccomp-util.h"
#include "service.h"
#include "set.h"
#include "stdio-util.h"
diff --git a/src/core/dbus-execute.c b/src/core/dbus-execute.c
index 52964390ae..395051e57f 100644
--- a/src/core/dbus-execute.c
+++ b/src/core/dbus-execute.c
@@ -2,11 +2,6 @@
#include <sys/mount.h>
#include <sys/prctl.h>
-
-#if HAVE_SECCOMP
-#include <seccomp.h>
-#endif
-
#include "af-list.h"
#include "alloc-util.h"
#include "bus-get-properties.h"
@@ -37,9 +32,7 @@
#include "pcre2-util.h"
#include "process-util.h"
#include "rlimit-util.h"
-#if HAVE_SECCOMP
#include "seccomp-util.h"
-#endif
#include "securebits-util.h"
#include "specifier.h"
#include "stat-util.h"
diff --git a/src/core/execute.c b/src/core/execute.c
index f9761b7239..5ffb088aee 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -26,10 +26,6 @@
#include <selinux/selinux.h>
#endif
-#if HAVE_SECCOMP
-#include <seccomp.h>
-#endif
-
#if HAVE_APPARMOR
#include <sys/apparmor.h>
#endif
@@ -93,9 +89,7 @@
#include "recurse-dir.h"
#include "rlimit-util.h"
#include "rm-rf.h"
-#if HAVE_SECCOMP
#include "seccomp-util.h"
-#endif
#include "securebits-util.h"
#include "selinux-util.h"
#include "signal-util.h"
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index ceca070e79..9d1fd0f7a7 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -7,9 +7,6 @@
#include <fcntl.h>
#include <linux/fs.h>
#include <linux/oom.h>
-#if HAVE_SECCOMP
-#include <seccomp.h>
-#endif
#include <sched.h>
#include <sys/resource.h>
@@ -56,9 +53,7 @@
#include "pcre2-util.h"
#include "percent-util.h"
#include "process-util.h"
-#if HAVE_SECCOMP
#include "seccomp-util.h"
-#endif
#include "securebits-util.h"
#include "selinux-util.h"
#include "signal-util.h"
diff --git a/src/core/main.c b/src/core/main.c
index c09f922700..df9cfa21aa 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -8,9 +8,6 @@
#include <sys/prctl.h>
#include <sys/utsname.h>
#include <unistd.h>
-#if HAVE_SECCOMP
-#include <seccomp.h>
-#endif
#if HAVE_VALGRIND_VALGRIND_H
# include <valgrind/valgrind.h>
#endif
@@ -82,9 +79,7 @@
#include "psi-util.h"
#include "random-util.h"
#include "rlimit-util.h"
-#if HAVE_SECCOMP
#include "seccomp-util.h"
-#endif
#include "selinux-setup.h"
#include "selinux-util.h"
#include "signal-util.h"
diff --git a/src/nspawn/nspawn-oci.c b/src/nspawn/nspawn-oci.c
index a4eda80ea0..5bdfebde78 100644
--- a/src/nspawn/nspawn-oci.c
+++ b/src/nspawn/nspawn-oci.c
@@ -1,9 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <linux/oom.h>
-#if HAVE_SECCOMP
-#include <seccomp.h>
-#endif
#include "bus-util.h"
#include "cap-list.h"
@@ -19,9 +16,7 @@
#include "nspawn-oci.h"
#include "path-util.h"
#include "rlimit-util.h"
-#if HAVE_SECCOMP
#include "seccomp-util.h"
-#endif
#include "stdio-util.h"
#include "string-util.h"
#include "strv.h"
diff --git a/src/nspawn/nspawn-seccomp.c b/src/nspawn/nspawn-seccomp.c
index 5f45f367d0..34a8627848 100644
--- a/src/nspawn/nspawn-seccomp.c
+++ b/src/nspawn/nspawn-seccomp.c
@@ -6,16 +6,10 @@
#include <sys/socket.h>
#include <sys/types.h>
-#if HAVE_SECCOMP
-#include <seccomp.h>
-#endif
-
#include "alloc-util.h"
#include "log.h"
#include "nspawn-seccomp.h"
-#if HAVE_SECCOMP
#include "seccomp-util.h"
-#endif
#include "string-util.h"
#include "strv.h"
diff --git a/src/nspawn/nspawn-settings.h b/src/nspawn/nspawn-settings.h
index 0a3d975364..8edf8a3552 100644
--- a/src/nspawn/nspawn-settings.h
+++ b/src/nspawn/nspawn-settings.h
@@ -4,10 +4,6 @@
#include <sched.h>
#include <stdio.h>
-#if HAVE_SECCOMP
-#include <seccomp.h>
-#endif
-
#include "sd-bus.h"
#include "sd-id128.h"
@@ -18,6 +14,7 @@
#include "missing_resource.h"
#include "nspawn-expose-ports.h"
#include "nspawn-mount.h"
+#include "seccomp-util.h"
#include "time-util.h"
typedef enum StartMode {
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index e614b05c83..d3ae547746 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -96,9 +96,7 @@
#include "resolve-util.h"
#include "rlimit-util.h"
#include "rm-rf.h"
-#if HAVE_SECCOMP
#include "seccomp-util.h"
-#endif
#include "selinux-util.h"
#include "signal-util.h"
#include "socket-util.h"
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
index 6ea5e138e0..ad1957d9d7 100644
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -37,9 +37,7 @@
#include "percent-util.h"
#include "process-util.h"
#include "rlimit-util.h"
-#if HAVE_SECCOMP
#include "seccomp-util.h"
-#endif
#include "securebits-util.h"
#include "signal-util.h"
#include "socket-util.h"
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index 2316d2b615..0be66c2c7b 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -23,9 +23,7 @@
#include "path-util.h"
#include "process-util.h"
#include "rm-rf.h"
-#if HAVE_SECCOMP
#include "seccomp-util.h"
-#endif
#include "service.h"
#include "signal-util.h"
#include "static-destruct.h"