From: Damien Miller Date: Tue, 27 Oct 2020 05:46:31 +0000 (+1100) Subject: Remove checks for strict POSIX mkdtemp() X-Git-Tag: V_8_5_P1~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33267feaffd5d98aa56d2f0b3a99ec352effe938;p=thirdparty%2Fopenssh-portable.git Remove checks for strict POSIX mkdtemp() We needed a mkdtemp() that accepted template paths that did not end in XXXXXX a long time ago for KRB4, but that code is long deprecated. We no longer need to replace mkdtemp() for strictly following POSIX. ok dtucker@ --- diff --git a/configure.ac b/configure.ac index 05f7b713b..d2d19a79c 100644 --- a/configure.ac +++ b/configure.ac @@ -2288,34 +2288,6 @@ if test "x$ac_cv_func_getpeereid" != "xyes" -a "x$ac_cv_func_getpeerucred" != "x ]) fi -dnl see whether mkstemp() requires XXXXXX -if test "x$ac_cv_func_mkdtemp" = "xyes" ; then -AC_MSG_CHECKING([for (overly) strict mkstemp]) -AC_RUN_IFELSE( - [AC_LANG_PROGRAM([[ -#include -#include - ]], [[ - char template[]="conftest.mkstemp-test"; - if (mkstemp(template) == -1) - exit(1); - unlink(template); - exit(0); - ]])], - [ - AC_MSG_RESULT([no]) - ], - [ - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_STRICT_MKSTEMP], [1], [Silly mkstemp()]) - ], - [ - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_STRICT_MKSTEMP]) - ] -) -fi - dnl make sure that openpty does not reacquire controlling terminal if test ! -z "$check_for_openpty_ctty_bug"; then AC_MSG_CHECKING([if openpty correctly handles controlling tty]) diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index 4eb52f421..ac922c1ec 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c @@ -34,7 +34,7 @@ #include #include -#if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) +#if !defined(HAVE_MKDTEMP) #define MKTEMP_NAME 0 #define MKTEMP_FILE 1 @@ -138,4 +138,4 @@ mkdtemp(char *path) return(error ? NULL : path); } -#endif /* !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) */ +#endif /* !defined(HAVE_MKDTEMP) */ diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index e5fd6f5bb..50bac587d 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -122,7 +122,7 @@ void strmode(int mode, char *p); char *strptime(const char *buf, const char *fmt, struct tm *tm); #endif -#if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) +#if !defined(HAVE_MKDTEMP) int mkstemps(char *path, int slen); int mkstemp(char *path); char *mkdtemp(char *path);