]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
configure.ac, lib/: Use __has_include(<sys/capability.h>) instead of HAVE_SYS_CAPABIL...
authorAlejandro Colomar <alx@kernel.org>
Tue, 12 Nov 2024 13:45:08 +0000 (14:45 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sat, 8 Feb 2025 05:43:55 +0000 (23:43 -0600)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
configure.ac
lib/idmapping.c

index 42a0a12d20a738612aa61dc1f4a08448bf77b2f0..adec5065ad350c378fbd916bfc2bfaa5cc9f2d73 100644 (file)
@@ -39,7 +39,6 @@ dnl Checks for libraries.
 dnl Checks for header files.
 AC_CHECK_HEADERS(utmp.h \
        termio.h sgtty.h sys/ioctl.h paths.h \
-       sys/capability.h \
        gshadow.h lastlog.h rpc/key_prot.h acl/libacl.h \
        attr/libattr.h attr/error_context.h)
 
index cef73b4f4f971c49a89287ae0cb690c1074de74c..ef685f32612b9785a9bc1f9cc821b4ba1d9475ec 100644 (file)
@@ -13,8 +13,8 @@
 #include <stdio.h>
 #include <strings.h>
 #include <sys/prctl.h>
-#if HAVE_SYS_CAPABILITY_H
-#include <sys/capability.h>
+#if __has_include(<sys/capability.h>)
+# include <sys/capability.h>
 #endif
 
 #include "alloc/calloc.h"
@@ -86,7 +86,7 @@ get_map_ranges(int ranges, int argc, char **argv)
  */
 #define ULONG_DIGITS (((WIDTHOF(unsigned long) + 9)/10)*3)
 
-#if HAVE_SYS_CAPABILITY_H
+#if __has_include(<sys/capability.h>)
 static inline bool maps_lower_root(int cap, int ranges, const struct map_range *mappings)
 {
        int idx;
@@ -129,7 +129,7 @@ void write_mapping(int proc_dir_fd, int ranges, const struct map_range *mappings
        char *buf, *pos, *end;
        int fd;
 
-#if HAVE_SYS_CAPABILITY_H
+#if __has_include(<sys/capability.h>)
        int cap;
        struct __user_cap_header_struct hdr = {_LINUX_CAPABILITY_VERSION_3, 0};
        struct __user_cap_data_struct data[2] = {{0}};