]> git.sesse.net Git - betaftpd/blobdiff - configure
Fixed a security problem where the custom snprintf() would always be used. Thanks...
[betaftpd] / configure
index ab01c51dfeff298644498903f01922873148ae20..d87a806bd8714e23ad8ce863b629e20a80661849 100755 (executable)
--- a/configure
+++ b/configure
@@ -2309,19 +2309,21 @@ rm -f conftest*
 fi
 
 if test "$result" = "no"; then
-       ac_safe=`echo "linux/socket.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for linux/socket.h""... $ac_c" 1>&6
-echo "configure:2315: checking for linux/socket.h" >&5
+       for ac_hdr in linux/socket.h linux/tcp.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:2317: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2320 "configure"
+#line 2322 "configure"
 #include "confdefs.h"
-#include <linux/socket.h>
+#include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2325: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2327: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2337,10 +2339,15 @@ rm -f conftest*
 fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  :
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
 else
   echo "$ac_t""no" 1>&6
 fi
+done
 
 fi
 
@@ -2348,17 +2355,17 @@ for ac_hdr in sys/poll.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2352: checking for $ac_hdr" >&5
+echo "configure:2359: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2357 "configure"
+#line 2364 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2386,9 +2393,9 @@ done
 
 
 echo $ac_n "checking for poll()""... $ac_c" 1>&6
-echo "configure:2390: checking for poll()" >&5
+echo "configure:2397: checking for poll()" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2392 "configure"
+#line 2399 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_POLL_H
@@ -2405,7 +2412,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   enableval=yes
 else
@@ -2428,17 +2435,17 @@ for ac_hdr in sys/sendfile.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2432: checking for $ac_hdr" >&5
+echo "configure:2439: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2437 "configure"
+#line 2444 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2468,9 +2475,9 @@ done
 
 if test "$result" = "yes"; then
        echo $ac_n "checking for Linux sendfile()""... $ac_c" 1>&6
-echo "configure:2472: checking for Linux sendfile()" >&5
+echo "configure:2479: checking for Linux sendfile()" >&5
        cat > conftest.$ac_ext <<EOF
-#line 2474 "configure"
+#line 2481 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_SOCKET_H
@@ -2511,7 +2518,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2515: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   enableval=yes
 else
@@ -2525,13 +2532,13 @@ rm -f conftest*
 
        if test "$enableval" = "yes"; then
                                                                                echo $ac_n "checking that sendfile() really is implemented""... $ac_c" 1>&6
-echo "configure:2529: checking that sendfile() really is implemented" >&5
+echo "configure:2536: checking that sendfile() really is implemented" >&5
 
                if test "$cross_compiling" = yes; then
   enableval="cross-compiling, not checked"
 else
   cat > conftest.$ac_ext <<EOF
-#line 2535 "configure"
+#line 2542 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_SOCKET_H
@@ -2575,7 +2582,7 @@ int main() {
                return 1;
 }
 EOF
-if { (eval echo configure:2579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   enableval=no
 else
@@ -2608,24 +2615,24 @@ EOF
                        has_sendfile=disabled
                fi
                echo $ac_n "checking final status of Linux sendfile() support""... $ac_c" 1>&6
-echo "configure:2612: checking final status of Linux sendfile() support" >&5
+echo "configure:2619: checking final status of Linux sendfile() support" >&5
                echo "$ac_t""$has_sendfile" 1>&6
        fi
 fi
 
 ac_safe=`echo "sys/uio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/uio.h""... $ac_c" 1>&6
-echo "configure:2619: checking for sys/uio.h" >&5
+echo "configure:2626: checking for sys/uio.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2624 "configure"
+#line 2631 "configure"
 #include "confdefs.h"
 #include <sys/uio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2649,9 +2656,9 @@ fi
 
 if test "$result" = "yes"; then
        echo $ac_n "checking for BSD sendfile()""... $ac_c" 1>&6
-echo "configure:2653: checking for BSD sendfile()" >&5
+echo "configure:2660: checking for BSD sendfile()" >&5
        cat > conftest.$ac_ext <<EOF
-#line 2655 "configure"
+#line 2662 "configure"
 #include "confdefs.h"
 
 #if HAVE_SYS_LIMITS_H
@@ -2692,7 +2699,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2696: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   enableval=yes
 else