]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Remove checks for strict POSIX mkdtemp()
authorDamien Miller <djm@mindrot.org>
Tue, 27 Oct 2020 05:46:31 +0000 (16:46 +1100)
committerDamien Miller <djm@mindrot.org>
Tue, 27 Oct 2020 05:50:38 +0000 (16:50 +1100)
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@

configure.ac
openbsd-compat/mktemp.c
openbsd-compat/openbsd-compat.h

index 05f7b713b5fa5b6d957eaacbe0e7cbf42e88cc84..d2d19a79c34ff2d78658f76c0a33d3d7bf0fa3f2 100644 (file)
@@ -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 <stdlib.h>
-#include <unistd.h>
-       ]], [[
-       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])
index 4eb52f421b72216558a110fb2c9fc60eac54ea78..ac922c1ecbe5c579233cf1ba44c98bfd59e31def 100644 (file)
@@ -34,7 +34,7 @@
 #include <ctype.h>
 #include <unistd.h>
 
-#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) */
index e5fd6f5bbaf32f1424c36bb16255f7c90c53f68a..50bac587d960ad476039225a963121e9e1523e61 100644 (file)
@@ -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);