From: Alejandro Colomar Date: Tue, 12 Nov 2024 13:45:08 +0000 (+0100) Subject: configure.ac, lib/: Use __has_include() instead of HAVE_SYS_CAPABIL... X-Git-Tag: 4.17.3~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d992f16b48ea0032100a4dd113805a624265af2;p=thirdparty%2Fshadow.git configure.ac, lib/: Use __has_include() instead of HAVE_SYS_CAPABILITY_H Signed-off-by: Alejandro Colomar --- diff --git a/configure.ac b/configure.ac index 42a0a12d2..adec5065a 100644 --- a/configure.ac +++ b/configure.ac @@ -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) diff --git a/lib/idmapping.c b/lib/idmapping.c index cef73b4f4..ef685f326 100644 --- a/lib/idmapping.c +++ b/lib/idmapping.c @@ -13,8 +13,8 @@ #include #include #include -#if HAVE_SYS_CAPABILITY_H -#include +#if __has_include() +# include #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() 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() int cap; struct __user_cap_header_struct hdr = {_LINUX_CAPABILITY_VERSION_3, 0}; struct __user_cap_data_struct data[2] = {{0}};