Change krb5_fcc_generate_new to use mkstemp rather than mktemp.
Ticket: new
Status: open
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16214
dc483132-0cff-0310-8789-
dd5450dbe970
+2004-03-25 Sam Hartman <hartmans@mit.edu>
+
+ * configure.in: Check for mkstemp
+
2004-03-08 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (LOCAL_SUBDIRS): Renamed from MY_SUBDIRS.
AC_PROG_LEX
AC_C_CONST
AC_CHECK_FUNCS(strdup setvbuf inet_ntoa inet_aton seteuid setresuid setreuid setegid setresgid setregid setsid flock fchmod chmod strftime strptime geteuid setenv unsetenv getenv gethostbyname2 getifaddrs)
+AC_CHECK_FUNCS( mkstemp)
AC_HEADER_STDARG
AC_CHECK_HEADERS(unistd.h paths.h regex.h regexp.h regexpr.h fcntl.h memory.h ifaddrs.h sys/filio.h)
dnl
+2004-03-25 Sam Hartman <hartmans@mit.edu>
+
+ * cc_file.c (krb5_fcc_generate_new): Use mkstemp not mktemp when possible
+
2004-03-18 Jeffrey Altman <jaltman@mit.edu>
* cc_mslsa.c:
krb5_fcc_generate_new (krb5_context context, krb5_ccache *id)
{
krb5_ccache lid;
-#ifndef USE_STDIO
int ret;
-#else
+#ifdef USE_STDIO
FILE *f;
#endif
krb5_error_code retcode = 0;
(void) strcpy(scratch, TKT_ROOT);
(void) strcat(scratch, "XXXXXX");
+#ifdef HAVE_MKSTEMP
+ ret = mkstemp(scratch);
+ if (ret == -1) {
+ return krb5_fcc_interpret(context, errno);
+ } else close(ret);
+#else /*HAVE_MKSTEMP*/
mktemp(scratch);
+#endif
lid->data = (krb5_pointer) malloc(sizeof(krb5_fcc_data));
if (lid->data == NULL) {