From 70e7d0b065e3b1d1e4eb2d7053690d7689705630 Mon Sep 17 00:00:00 2001 From: djm Date: Tue, 7 Jan 2003 04:18:32 +0000 Subject: [PATCH] - (djm) Bug #26: Use local mkstemp() rather than glibc's silly one. Fixes Can't pass KRB4 TGT passing. Fix from: jan.iven@cern.ch --- ChangeLog | 2 ++ acconfig.h | 3 +++ configure.ac | 26 ++++++++++++++++++++++++++ openbsd-compat/mktemp.c | 4 ++-- openbsd-compat/mktemp.h | 4 ++-- 5 files changed, 35 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c103b68..20e2fa3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Based on fix from yoshfuji@linux-ipv6.org - (djm) Bug #442: Check for and deny access to accounts with locked passwords. Patch from dtucker@zip.com.au + - (djm) Bug #26: Use local mkstemp() rather than glibc's silly one. Fixes + Can't pass KRB4 TGT passing. Fix from: jan.iven@cern.ch 20030103 - (djm) Bug #461: ssh-copy-id fails with no arguments. Patch from diff --git a/acconfig.h b/acconfig.h index cb96abdc..0dc09642 100644 --- a/acconfig.h +++ b/acconfig.h @@ -364,6 +364,9 @@ /* Define if your platform needs to skip post auth file descriptor passing */ #undef DISABLE_FD_PASSING +/* Silly mkstemp() */ +#undef HAVE_STRICT_MKSTEMP + @BOTTOM@ /* ******************* Shouldn't need to edit below this line ************** */ diff --git a/configure.ac b/configure.ac index d652a6e9..146bc906 100644 --- a/configure.ac +++ b/configure.ac @@ -680,6 +680,32 @@ int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');} ) fi +dnl see whether mkstemp() requires XXXXXX +if test "x$ac_cv_func_mkdtemp" = "xyes" ; then +AC_MSG_CHECKING([for (overly) strict mkstemp]) +AC_TRY_RUN( + [ +#include +main() { 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) + ], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_STRICT_MKSTEMP) + ] +) +fi + AC_FUNC_GETPGRP # Check for PAM libs diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index d256ee44..c951050c 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c @@ -36,7 +36,7 @@ #include "includes.h" -#ifndef HAVE_MKDTEMP +#if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) #if defined(LIBC_SCCS) && !defined(lint) static char rcsid[] = "$OpenBSD: mktemp.c,v 1.16 2002/05/27 18:20:45 millert Exp $"; @@ -181,4 +181,4 @@ _gettemp(path, doopen, domkdir, slen) /*NOTREACHED*/ } -#endif /* !HAVE_MKDTEMP */ +#endif /* !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) */ diff --git a/openbsd-compat/mktemp.h b/openbsd-compat/mktemp.h index f7993875..5851d5b1 100644 --- a/openbsd-compat/mktemp.h +++ b/openbsd-compat/mktemp.h @@ -4,10 +4,10 @@ #define _BSD_MKTEMP_H #include "config.h" -#ifndef HAVE_MKDTEMP +#if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) int mkstemps(char *path, int slen); int mkstemp(char *path); char *mkdtemp(char *path); -#endif /* !HAVE_MKDTEMP */ +#endif /* !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) */ #endif /* _BSD_MKTEMP_H */ -- 2.45.1