#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
+else
+ break
fi
done
;;
esac
- if test X"$ac_cv_func_mkstemps" = X"no"; then
+ # If either mkdtemp() or mkstemps() is missing, replace both.
- for _sym in sudo_mkstemps; do
+ for _sym in sudo_mkdtemp sudo_mkstemps; do
COMPAT_EXP="${COMPAT_EXP}${_sym}
"
done
- fi
- if test X"$ac_cv_func_mkdtemp" = X"no"; then
-
- for _sym in sudo_mkdtemp; do
- COMPAT_EXP="${COMPAT_EXP}${_sym}
-"
- done
-
- fi
fi
for ac_func in snprintf vsnprintf
do :
# include <limits.h>
# include <fcntl.h> ])
])
-AC_CHECK_FUNCS(mkstemps mkdtemp)
+AC_CHECK_FUNCS(mkstemps mkdtemp, [], [break])
if test X"$ac_cv_func_mkstemps$ac_cv_func_mkdtemp" != X"yesyes"; then
AC_CHECK_FUNCS(random lrand48, [break])
AC_LIBOBJ(mktemp)
- if test X"$ac_cv_func_mkstemps" = X"no"; then
- SUDO_APPEND_COMPAT_EXP(sudo_mkstemps)
- fi
- if test X"$ac_cv_func_mkdtemp" = X"no"; then
- SUDO_APPEND_COMPAT_EXP(sudo_mkdtemp)
- fi
+ # If either mkdtemp() or mkstemps() is missing, replace both.
+ SUDO_APPEND_COMPAT_EXP(sudo_mkdtemp sudo_mkstemps)
fi
AX_FUNC_SNPRINTF
if test X"$ac_cv_have_working_snprintf$ac_cv_have_working_vsnprintf" = X"yesyes"; then
# undef memset_s
# define memset_s(_a, _b, _c, _d) sudo_memset_s((_a), (_b), (_c), (_d))
#endif /* HAVE_MEMSET_S */
-#ifndef HAVE_MKDTEMP
+#if !defined(HAVE_MKDTEMP) || !defined(HAVE_MKSTEMPS)
__dso_public char *sudo_mkdtemp(char *path);
# undef mkdtemp
# define mkdtemp(_a) sudo_mkdtemp((_a))
-#endif /* HAVE_MKDTEMP */
-#ifndef HAVE_MKSTEMPS
__dso_public int sudo_mkstemps(char *path, int slen);
# undef mkstemps
# define mkstemps(_a, _b) sudo_mkstemps((_a), (_b))
-#endif /* HAVE_MKSTEMPS */
+#endif /* !HAVE_MKDTEMP || !HAVE_MKSTEMPS */
#ifndef HAVE_PW_DUP
__dso_public struct passwd *sudo_pw_dup(const struct passwd *pw);
# undef pw_dup
return -1;
}
-#ifndef HAVE_MKSTEMPS
int
sudo_mkstemps(char *path, int slen)
{
return mktemp_internal(path, slen, MKTEMP_FILE);
}
-#endif /* HAVE_MKSTEMPS */
-#ifndef HAVE_MKDTEMP
char *
sudo_mkdtemp(char *path)
{
return NULL;
return path;
}
-#endif /* HAVE_MKDTEMP */
#endif /* !HAVE_MKSTEMPS || !HAVE_MKDTEMP */