]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
{configure.ac,meson.build}: conditionally build {enosys,setpriv} if seccomp is presen...
authorThomas Devoogdt <thomas.devoogdt@barco.com>
Thu, 6 Mar 2025 10:49:12 +0000 (11:49 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 10 Mar 2025 13:49:34 +0000 (14:49 +0100)
misc-utils/enosys.c:25:27: fatal error: linux/seccomp.h: No such file or directory
 #include <linux/seccomp.h>

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
(cherry picked from commit 8de1ec203b0fbf86ae67b1ac18ba094d36b6a34a)

configure.ac
meson.build

index 7a55ea6c608c4e8d4714d5d735d543b24db34b5e..add5a280eb3d6ae541f91127411a6eadedd7daaa 100644 (file)
@@ -349,6 +349,7 @@ AC_CHECK_HEADERS([ \
        linux/nsfs.h \
        linux/pr.h \
        linux/raw.h \
+       linux/seccomp.h \
        linux/securebits.h \
        linux/tiocl.h \
        linux/version.h \
@@ -515,6 +516,7 @@ have_linux_kcmp_h=$ac_cv_header_linux_kcmp_h
 have_linux_mount_h=$ac_cv_header_linux_mount_h
 have_linux_pr_h=$ac_cv_header_linux_pr_h
 have_linux_raw_h=$ac_cv_header_linux_raw_h
+have_linux_seccomp_h=$ac_cv_header_linux_seccomp_h
 have_linux_securebits_h=$ac_cv_header_linux_securebits_h
 have_linux_version_h=$ac_cv_header_linux_version_h
 have_linux_watchdog_h=$ac_cv_header_linux_watchdog_h
@@ -1704,6 +1706,7 @@ AC_ARG_ENABLE([setpriv],
 )
 UL_BUILD_INIT([setpriv])
 UL_REQUIRES_LINUX([setpriv])
+UL_REQUIRES_HAVE([setpriv], [linux_seccomp_h], [linux/seccomp.h header file])
 UL_REQUIRES_HAVE([setpriv], [linux_securebits_h], [linux/securebits.h header file])
 UL_REQUIRES_HAVE([setpriv], [linux_capability_h], [linux/capability.h header file])
 UL_REQUIRES_HAVE([setpriv], [cap_ng], [libcap-ng library])
@@ -2021,6 +2024,7 @@ AC_ARG_ENABLE([enosys],
 UL_BUILD_INIT([enosys])
 UL_REQUIRES_LINUX([enosys])
 UL_REQUIRES_HAVE([enosys], [linux_audit_h], [linux/audit.h header file])
+UL_REQUIRES_HAVE([enosys], [linux_seccomp_h], [linux/seccomp.h header file])
 AS_IF([test "x$build_enosys" = xyes], [
   AC_MSG_CHECKING([for valid audit arch])
   AC_COMPILE_IFELSE(
index b48cc53cc3ad3b35b04e5c52cb61c0b8833da760..2c7477789b1eb522279e8b10bc90e00c1109145f 100644 (file)
@@ -2156,7 +2156,9 @@ if opt and not is_disabler(exe)
   exes += exe
 endif
 
-opt = not get_option('build-setpriv').disabled() and lib_cap_ng.found()
+opt = not get_option('build-setpriv').disabled() \
+      and lib_cap_ng.found() \
+      and cc.has_header('linux/seccomp.h')
 exe = executable(
   'setpriv',
   setpriv_sources,
@@ -3313,9 +3315,10 @@ syscalls_h = custom_target('syscalls.h',
 )
 
 have_linux_audit_h = cc.has_header('linux/audit.h')
+have_linux_seccomp_h = cc.has_header('linux/seccomp.h')
 have_audit_arch_native = cc.compiles(fs.read('include/audit-arch.h'), name : 'has AUDIT_ARCH_NATIVE')
 
-opt = get_option('build-enosys').require(have_linux_audit_h and have_audit_arch_native).allowed()
+opt = get_option('build-enosys').require(have_linux_audit_h and have_linux_seccomp_h and have_audit_arch_native).allowed()
 exe = executable(
   'enosys',
   'misc-utils/enosys.c', syscalls_h, errnos_h,