]> granicus.if.org Git - sudo/commitdiff
Add checks for setresuid() and a way to disable using it
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 22 Nov 2002 19:07:04 +0000 (19:07 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 22 Nov 2002 19:07:04 +0000 (19:07 +0000)
configure.in

index 85c7b15e8e6cd4e1ea3a3cb2e33cda88a2f4936e..24b18236e6a4b1d6ee754e25d19fba2862c9e264 100644 (file)
@@ -991,7 +991,16 @@ AC_ARG_ENABLE(root-mailer,
 AC_ARG_ENABLE(setreuid,
 [  --disable-setreuid      Don't try to use the setreuid() function],
 [ case "$enableval" in
-    no)                BROKEN_SETREUID=1
+    no)                SKIP_SETREUID=yes
+               ;;
+    *)         ;;
+  esac
+])
+
+AC_ARG_ENABLE(setresuid,
+[  --disable-setresuid      Don't try to use the setresuid() function],
+[ case "$enableval" in
+    no)                SKIP_SETRESUID=yes
                ;;
     *)         ;;
   esac
@@ -1441,7 +1450,7 @@ case "$host" in
                test -n "$mansectform" || mansectform=4
                ;;
     *-*-bsdi*)
-               BROKEN_SETREUID=yes
+               SKIP_SETREUID=yes
                # Use shlicc for BSD/OS [23].x unless asked to do otherwise
                if test "${with_CC+set}" != set -a "$ac_cv_prog_CC" = gcc; then
                    case "$OSREV" in
@@ -1457,7 +1466,7 @@ case "$host" in
                # backported to 2.0.5.  We just take 2.1 and above...
                case "`echo $host_os | sed 's/^freebsd\([[0-9\.]]*\).*$/\1/'`" in
                0.*|1.*|2.0*)
-                   BROKEN_SETREUID=yes
+                   SKIP_SETREUID=yes
                    ;;
                esac
                if test "$with_logincap" = "yes"; then
@@ -1471,7 +1480,7 @@ case "$host" in
                fi
                ;;
     *-*-*openbsd*)
-               BROKEN_SETREUID=yes
+               SKIP_SETREUID=yes
                if test "$CHECKSHADOW" = "true"; then
                    CHECKSHADOW="false"
                fi
@@ -1480,7 +1489,7 @@ case "$host" in
                # NetBSD has a real setreuid(2) starting with 1.3.2
                case "`echo $host_os | sed 's/^netbsd\([[0-9\.]]*\).*$/\1/'`" in
                0.9*|1.[012]*|1.3|1.3.1)
-                   BROKEN_SETREUID=yes
+                   SKIP_SETREUID=yes
                    ;;
                esac
                if test "$CHECKSHADOW" = "true"; then
@@ -1587,8 +1596,11 @@ dnl
 dnl Function checks
 dnl
 AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf tzset \
-              seteuid setegid strftime setrlimit initgroups fstat)
-if test -z "$BROKEN_SETREUID"; then
+              strftime setrlimit initgroups fstat)
+if test -z "$SKIP_SETRESUID"; then
+    AC_CHECK_FUNCS(setresuid, [SKIP_SETREUID=yes])
+fi
+if test -z "$SKIP_SETREUID"; then
     AC_CHECK_FUNCS(setreuid)
 fi
 if test X"$with_interfaces" != X"no"; then