]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_8] portability fix
authorEvan Hunt <each@isc.org>
Thu, 11 Jul 2013 03:46:16 +0000 (20:46 -0700)
committerEvan Hunt <each@isc.org>
Thu, 11 Jul 2013 03:46:16 +0000 (20:46 -0700)
3614. [port] Check for <linux/types.h>. [RT #34162]
(cherry picked from commit c174d5c13c03dd59283243e3fd5461d41140a798)
(cherry picked from commit e57ea0e52f09ac5a6c1a0e7af0538345dd2b744b)

CHANGES
bin/named/unix/os.c
config.h.in
configure
configure.in

diff --git a/CHANGES b/CHANGES
index ccbeb3602d2845eee3eb318b44f54125e7d722c5..3425b8331d3235c6791d3e3b140851519978e040 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3614.  [port]          Check for <linux/types.h>. [RT #34162]
+
 3611.  [bug]           Improved resistance to a theoretical authentication
                        attack based on differential timing.  [RT #33939]
 
index 9637ded473e5b9213000fcf86a08c9499350f80f..3d011bb4d5d04800f1e4bec29db95f9114da1707 100644 (file)
@@ -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 <linux/types.h>
+#endif
 #ifdef HAVE_SYS_CAPABILITY_H
 #include <sys/capability.h>
 #else
index 6cef67682b4935f4864fcafcbda875d49995543e..ee0674b70552a5518d2874451dc105c2711572b4 100644 (file)
@@ -271,6 +271,9 @@ int sigwait(const unsigned int *set, int *sig);
 /* Define to 1 if you have the <linux/capability.h> header file. */
 #undef HAVE_LINUX_CAPABILITY_H
 
+/* Define to 1 if you have the <linux/types.h> header file. */
+#undef HAVE_LINUX_TYPES_H
+
 /* Define to 1 if you have the <locale.h> header file. */
 #undef HAVE_LOCALE_H
 
index 217088d81e51b5bf2bfef6a7826478fbc59fbf3c..f462f48a48b85ff8ec81a6dd1d91e5a06467cac4 100755 (executable)
--- a/configure
+++ b/configure
 
 case "$enable_linux_caps" in
        yes|'')
+               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 <linux/types.h>
+                                 #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
index 3b44455b078b4cc16132b854bdb69311cfea36a1..a9297f9205bab4528f1399b0e1884d96805ab433 100644 (file)
@@ -2424,7 +2424,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 <linux/types.h>
+                                 #endif
+                                ])
                AC_CHECK_LIB(cap, cap_set_proc)
                ;;
        no)