summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@sudo.ws>2022-09-21 19:08:11 -0600
committerTodd C. Miller <Todd.Miller@sudo.ws>2022-09-21 19:08:11 -0600
commit912338f569bea4881e1b7850db154df4f4a01427 (patch)
tree0e5a533e5bd2b1d5fe26aeec03ff8aee244d50ea /configure.ac
parent1dae1f88a09a92b61bd442b28d7a284fc1a680df (diff)
downloadsudo-912338f569bea4881e1b7850db154df4f4a01427.tar.gz
Add mkdtempat() and mkostempsat() for systems without them.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac9
1 files changed, 5 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 177c6c3d7..427bfa794 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2957,15 +2957,16 @@ AC_CHECK_FUNCS([closefrom], [], [AC_LIBOBJ(closefrom)
# include <fcntl.h> ])
COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }closefrom_test"
])
-AC_CHECK_FUNCS([mkstemps mkdtemp], [], [break])
-if test X"$ac_cv_func_mkstemps$ac_cv_func_mkdtemp" != X"yesyes"; then
+sudo_mktemp=no
+AC_CHECK_FUNCS([mkdtempat mkostempsat mkstemps mkdtemp], [], [sudo_mktemp=yes; break])
+# If any of the mktemp family are missing we use our own.
+if test X"$sudo_mktemp" = X"yes"; then
AC_CHECK_FUNCS([arc4random random lrand48], [break])
if test X"$ac_cv_func_arc4random" != X"yes"; then
AC_CHECK_FUNCS([getentropy])
fi
AC_LIBOBJ(mktemp)
- # If either mkdtemp() or mkstemps() is missing, replace both.
- SUDO_APPEND_COMPAT_EXP(sudo_mkdtemp sudo_mkstemps)
+ SUDO_APPEND_COMPAT_EXP(sudo_mkdtemp sudo_mkdtempat sudo_mkostempsat sudo_mkstemp sudo_mkstemps)
COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }mktemp_test"
fi
AX_FUNC_SNPRINTF