From 7fc0aa09838f76717549f48315fd2dad8c0a1176 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 6 Dec 2008 20:12:26 +0000 Subject: Partial fix for [Bug 2388866] --- ChangeLog | 7 +++++++ generic/tclCmdAH.c | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1ed290d..35d07d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-12-06 Donal K. Fellows + + * generic/tclCmdAH.c (FileTempfileCmd): Force temporary files to be + created in the native filesystem. Attempting to provide a template + that puts it elsewhere will result in the directory part of the + template being ignored. Partial address of [Bug 2388866] concerns. + 2008-12-05 Donal K. Fellows TIP #335 IMPLEMENTATION diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index ead9384..bc02f16 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.111 2008/12/02 19:40:41 dgp Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.112 2008/12/06 20:12:27 dkf Exp $ */ #include "tclInt.h" @@ -1704,6 +1704,18 @@ FileTempfileCmd( || (tclPlatform == TCL_PLATFORM_WINDOWS && strchr(string, '\\') != NULL)) { tempDirObj = TclPathPart(interp, objv[3], TCL_PATH_DIRNAME); + + /* + * Only allow creation of temporary files in the native filesystem + * since they are frequently used for integration with external + * tools or system libraries. [Bug 2388866] + */ + + if (Tcl_FSGetFileSystemForPath(tempDirObj) + != &tclNativeFilesystem) { + TclDecrRefCount(tempDirObj); + tempDirObj = NULL; + } } /* -- cgit v0.12