diff --git a/config.h.in b/config.h.in index d0be95822..149558a30 100644 --- a/config.h.in +++ b/config.h.in @@ -1021,6 +1021,9 @@ /* Define to 1 if you have the `va_copy' function. */ #undef HAVE_VA_COPY +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK + /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF diff --git a/configure b/configure index b6d1f3c4b..78e41af65 100755 --- a/configure +++ b/configure @@ -3261,6 +3261,7 @@ as_fn_append ac_func_c_list " faccessat HAVE_FACCESSAT" as_fn_append ac_func_c_list " wordexp HAVE_WORDEXP" as_fn_append ac_func_c_list " getauxval HAVE_GETAUXVAL" as_fn_append ac_func_c_list " strtoull HAVE_STRTOULL" +as_fn_append ac_func_c_list " vfork HAVE_VFORK" as_fn_append ac_func_c_list " seteuid HAVE_SETEUID" # Auxiliary files required by this configure script. @@ -21259,6 +21260,7 @@ done + for ac_func in execvpe do : ac_fn_c_check_func "$LINENO" "execvpe" "ac_cv_func_execvpe" diff --git a/configure.ac b/configure.ac index 31ab3c3c8..6aa4a2b8b 100644 --- a/configure.ac +++ b/configure.ac @@ -2605,7 +2605,7 @@ dnl Function checks dnl AC_FUNC_GETGROUPS AC_FUNC_FSEEKO -AC_CHECK_FUNCS_ONCE([fexecve fmemopen killpg nl_langinfo faccessat wordexp getauxval strtoull]) +AC_CHECK_FUNCS_ONCE([fexecve fmemopen killpg nl_langinfo faccessat wordexp getauxval strtoull vfork]) AC_CHECK_FUNCS([execvpe], [SUDO_APPEND_INTERCEPT_EXP(execvpe)]) AC_CHECK_FUNCS([pread], [ # pread/pwrite on 32-bit HP-UX 11.x may not support large files diff --git a/src/sudo_intercept.c b/src/sudo_intercept.c index 1629dfbe3..cbaa005a6 100644 --- a/src/sudo_intercept.c +++ b/src/sudo_intercept.c @@ -52,6 +52,10 @@ #include "sudo_util.h" #include "pathnames.h" +#ifndef HAVE_VFORK +# define vfork fork +#endif + /* execl flavors */ #define SUDO_EXECL 0x0 #define SUDO_EXECLE 0x1