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

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

diff --git a/CHANGES b/CHANGES
index 30a8859829180e87b42ba148a9bd6da40bd8e872..0359c6aefacb72698d58c6da78a4bb8db289d723 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 a7ddee5f86afa0888ef8acf56711af0664ce54f0..750a8a64d8652a18bc7397edd4753b143e2b2372 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 6c7968e5e3f013aaf1842fc32188b753a271bcfa..374b323097e96ccecf824e0e43009e28fefcdb23 100644 (file)
@@ -241,6 +241,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 6190e9420584c6246b6a93d7343ba6c25ac88866..5d60e18f1bf8d6ef72327010d6bf23398fd78a22 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 4274f7afe0234b8bbbbddac25161e9094354c409..34c256a73cc32aff02b26b7537a868f408ba9191 100644 (file)
@@ -2070,7 +2070,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)