From c174d5c13c03dd59283243e3fd5461d41140a798 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Wed, 10 Jul 2013 20:44:58 -0700 Subject: [PATCH] [master] portability fix 3614. [port] Check for . [RT #34162] --- CHANGES | 2 ++ bin/named/unix/os.c | 3 +++ config.h.in | 3 +++ configure | 20 ++++++++++++++++++-- configure.in | 7 ++++++- 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index e1a70b04ad..6b00cdd16e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3614. [port] Check for . [RT #34162] + 3613. [bug] named could crash when deleting inline-signing zones with "rndc delzone". [RT #34066] diff --git a/bin/named/unix/os.c b/bin/named/unix/os.c index 4f5f55c3ee..24f0c307c1 100644 --- a/bin/named/unix/os.c +++ b/bin/named/unix/os.c @@ -117,6 +117,9 @@ static int dfd[2] = { -1, -1 }; static isc_boolean_t non_root = ISC_FALSE; static isc_boolean_t non_root_caps = ISC_FALSE; +#ifdef HAVE_LINUX_TYPES_H +#include +#endif #ifdef HAVE_SYS_CAPABILITY_H #include #else diff --git a/config.h.in b/config.h.in index d2e8478b34..89aa492ffe 100644 --- a/config.h.in +++ b/config.h.in @@ -284,6 +284,9 @@ int sigwait(const unsigned int *set, int *sig); /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_CAPABILITY_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_TYPES_H + /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H diff --git a/configure b/configure index 47806e6aa3..2c9c8e2534 100755 --- a/configure +++ b/configure @@ -18033,10 +18033,26 @@ fi case "$enable_linux_caps" in yes|'') - for ac_header in linux/capability.h sys/capability.h + for ac_header in linux/types.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "linux/types.h" "ac_cv_header_linux_types_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_types_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_TYPES_H 1 +_ACEOF + +fi + +done + + for ac_header in linux/capability.h sys/capability.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_LINUX_TYPES_H + #include + #endif + +" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 diff --git a/configure.in b/configure.in index 5ddbd4c953..3509908aa8 100644 --- a/configure.in +++ b/configure.in @@ -2618,7 +2618,12 @@ AC_ARG_ENABLE(linux-caps, [ --disable-linux-caps disable linux capabilities]) case "$enable_linux_caps" in yes|'') - AC_CHECK_HEADERS(linux/capability.h sys/capability.h) + AC_CHECK_HEADERS(linux/types.h) + AC_CHECK_HEADERS([linux/capability.h sys/capability.h], [], [], + [#ifdef HAVE_LINUX_TYPES_H + #include + #endif + ]) AC_CHECK_LIB(cap, cap_set_proc) ;; no)