]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
more thorough check for setresuid(); esp needed on linux
authorwessels <>
Tue, 30 Dec 1997 09:49:40 +0000 (09:49 +0000)
committerwessels <>
Tue, 30 Dec 1997 09:49:40 +0000 (09:49 +0000)
configure
configure.in
include/autoconf.h.in

index 3ffd83a1e1f97a6e893059f4771b603a5ee3831b..4c280564fa052e64af2a9a8fb71733347b2645d1 100755 (executable)
--- a/configure
+++ b/configure
@@ -2929,7 +2929,6 @@ for ac_func in \
        res_init \
        seteuid \
        setpgrp \
-       setresuid \
        setrlimit \
        setsid \
        sigaction \
@@ -2944,12 +2943,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2948: checking for $ac_func" >&5
+echo "configure:2947: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2953 "configure"
+#line 2952 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2972,7 +2971,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3005,8 +3004,49 @@ case "$host" in
                ;;
 esac
 
+echo $ac_n "checking if setresuid is implemented""... $ac_c" 1>&6
+echo "configure:3009: checking if setresuid is implemented" >&5
+if eval "test \"`echo '$''{'ac_cv_func_setresuid'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3017 "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+int 
+main()
+{
+    if (setresuid(-1, -1, -1)) {
+       perror("setresuid:");
+       exit(1);
+    }
+    exit(0);
+}
+
+EOF
+if { (eval echo configure:3032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_func_setresuid="yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_func_setresuid="no"
+fi
+rm -fr conftest*
+fi
+
+
+fi
+
+echo "$ac_t""$ac_cv_func_setresuid" 1>&6
+
 echo $ac_n "checking if GNUregex needs to be compiled""... $ac_c" 1>&6
-echo "configure:3010: checking if GNUregex needs to be compiled" >&5
+echo "configure:3050: checking if GNUregex needs to be compiled" >&5
 if test "$ac_cv_func_regcomp" = "no" ; then
        USE_GNUREGEX="yes"
 else
@@ -3038,12 +3078,12 @@ for ac_func in \
 
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3042: checking for $ac_func" >&5
+echo "configure:3082: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3047 "configure"
+#line 3087 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3066,7 +3106,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3110: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3094,12 +3134,12 @@ done
 
 
 echo $ac_n "checking Default FD_SETSIZE value""... $ac_c" 1>&6
-echo "configure:3098: checking Default FD_SETSIZE value" >&5
+echo "configure:3138: checking Default FD_SETSIZE value" >&5
 if test "$cross_compiling" = yes; then
   DEFAULT_FD_SETSIZE=256
 else
   cat > conftest.$ac_ext <<EOF
-#line 3103 "configure"
+#line 3143 "configure"
 #include "confdefs.h"
 
 #if HAVE_STDIO_H
@@ -3123,7 +3163,7 @@ main() {
 }
 
 EOF
-if { (eval echo configure:3127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   DEFAULT_FD_SETSIZE=`cat conftestval`
 else
@@ -3142,12 +3182,12 @@ EOF
 
 
 echo $ac_n "checking Maximum number of filedescriptors we can open""... $ac_c" 1>&6
-echo "configure:3146: checking Maximum number of filedescriptors we can open" >&5
+echo "configure:3186: checking Maximum number of filedescriptors we can open" >&5
 if test "$cross_compiling" = yes; then
   SQUID_MAXFD=256
 else
   cat > conftest.$ac_ext <<EOF
-#line 3151 "configure"
+#line 3191 "configure"
 #include "confdefs.h"
 
 #include <stdio.h>
@@ -3199,7 +3239,7 @@ main() {
 }
 
 EOF
-if { (eval echo configure:3203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_MAXFD=`cat conftestval`
 else
@@ -3218,12 +3258,12 @@ EOF
 
 
 echo $ac_n "checking Default UDP send buffer size""... $ac_c" 1>&6
-echo "configure:3222: checking Default UDP send buffer size" >&5
+echo "configure:3262: checking Default UDP send buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_SNDBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 3227 "configure"
+#line 3267 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3242,7 +3282,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:3246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_UDP_SO_SNDBUF=`cat conftestval`
 else
@@ -3261,12 +3301,12 @@ EOF
 
 
 echo $ac_n "checking Default UDP receive buffer size""... $ac_c" 1>&6
-echo "configure:3265: checking Default UDP receive buffer size" >&5
+echo "configure:3305: checking Default UDP receive buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_UDP_SO_RCVBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 3270 "configure"
+#line 3310 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3285,7 +3325,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:3289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_UDP_SO_RCVBUF=`cat conftestval`
 else
@@ -3304,12 +3344,12 @@ EOF
 
 
 echo $ac_n "checking Default TCP send buffer size""... $ac_c" 1>&6
-echo "configure:3308: checking Default TCP send buffer size" >&5
+echo "configure:3348: checking Default TCP send buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_SNDBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 3313 "configure"
+#line 3353 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3328,7 +3368,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:3332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_TCP_SO_SNDBUF=`cat conftestval`
 else
@@ -3347,12 +3387,12 @@ EOF
 
 
 echo $ac_n "checking Default TCP receive buffer size""... $ac_c" 1>&6
-echo "configure:3351: checking Default TCP receive buffer size" >&5
+echo "configure:3391: checking Default TCP receive buffer size" >&5
 if test "$cross_compiling" = yes; then
   SQUID_TCP_SO_RCVBUF=16384
 else
   cat > conftest.$ac_ext <<EOF
-#line 3356 "configure"
+#line 3396 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -3371,7 +3411,7 @@ main ()
 }
 
 EOF
-if { (eval echo configure:3375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   SQUID_TCP_SO_RCVBUF=`cat conftestval`
 else
@@ -3390,16 +3430,16 @@ EOF
 
 
 echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6
-echo "configure:3394: checking if sys_errlist is already defined" >&5
+echo "configure:3434: checking if sys_errlist is already defined" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3396 "configure"
+#line 3436 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 int main() {
 char *s = sys_errlist[0];
 ; return 0; }
 EOF
-if { (eval echo configure:3403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3443: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -3415,16 +3455,16 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for libresolv _dns_ttl_ hack""... $ac_c" 1>&6
-echo "configure:3419: checking for libresolv _dns_ttl_ hack" >&5
+echo "configure:3459: checking for libresolv _dns_ttl_ hack" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3421 "configure"
+#line 3461 "configure"
 #include "confdefs.h"
 extern int _dns_ttl_;
 int main() {
 return _dns_ttl_;
 ; return 0; }
 EOF
-if { (eval echo configure:3428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 cat >> confdefs.h <<\EOF
index 479b3c80df79aeb21688de25ce3813d5338fffc0..621d285f2353a6cc1eee340340e56ae49f74680b 100644 (file)
@@ -3,13 +3,13 @@ dnl  Configuration input file for Squid
 dnl
 dnl  Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9)
 dnl
-dnl  $Id: configure.in,v 1.84 1997/12/06 05:45:24 wessels Exp $
+dnl  $Id: configure.in,v 1.85 1997/12/30 02:49:41 wessels Exp $
 dnl
 dnl
 dnl
 AC_INIT(src/main.c)
 AC_CONFIG_HEADER(include/autoconf.h)
-AC_REVISION($Revision: 1.84 $)dnl
+AC_REVISION($Revision: 1.85 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AC_CONFIG_AUX_DIR(aux)
 
@@ -335,7 +335,6 @@ AC_CHECK_FUNCS(\
        res_init \
        seteuid \
        setpgrp \
-       setresuid \
        setrlimit \
        setsid \
        sigaction \
@@ -357,6 +356,25 @@ case "$host" in
                ;;
 esac
 
+dnl Yay!  Another Linux brokenness.  Its not good enough
+dnl to know that setresuid() exists, because RedHat 5.0 declares
+dnl setresuid() but doesn't implement it.
+dnl
+AC_CACHE_CHECK(if setresuid is implemented, ac_cv_func_setresuid,
+AC_TRY_RUN([
+#include <stdlib.h>
+int 
+main()
+{
+    if (setresuid(-1, -1, -1)) {
+       perror("setresuid:");
+       exit(1);
+    }
+    exit(0);
+}
+],ac_cv_func_setresuid="yes",ac_cv_func_setresuid="no")
+)
+
 AC_MSG_CHECKING(if GNUregex needs to be compiled)
 if test "$ac_cv_func_regcomp" = "no" ; then
        USE_GNUREGEX="yes"
index 12d5c6b7a1a6679605bcc5174dc20e03b704ef2e..64e5164d563e652a36c8dbef8464eb1174b88a0c 100644 (file)
 /* Define if you have the setpgrp function.  */
 #undef HAVE_SETPGRP
 
-/* Define if you have the setresuid function.  */
-#undef HAVE_SETRESUID
-
 /* Define if you have the setrlimit function.  */
 #undef HAVE_SETRLIMIT