Tcl Source Code

View Ticket
Login
Ticket UUID: 2933003
Title: Non-configurable tempdir for child stderr
Type: Bug Created on: 2010-01-15 17:48:11
Submitter: ferrieux Assigned to: dkf
Subsystem: 37. File System Severity:
Priority: 9 Immediate Last modified: 2012-11-14 21:38:34
Status: Closed Closed by: dkf
Resolution: Fixed Closed on: 2012-11-14 14:38:34
Version: obsolete: 8.5.12
Description:
When using [exec] or [open|] without a 2> or 2>@ redirection, the child's file descriptor 2 flows into a temporary file, but the directory used is not configurable (P_tempdir, typically "/tmp"). This causes headaches to people operating in restricted environments where /tmp is not writable:

http://groups.google.com/group/comp.lang.tcl/tree/browse_frm/thread/ca773f80bfc6b9f8/34f5e85071852f72?rnum=1&_done=%2Fgroup%2Fcomp.lang.tcl%2Fbrowse_frm%2Fthread%2Fca773f80bfc6b9f8%3F#doc_34f5e85071852f72

I think that the old function TclpCreateTempFile doing this should either be dropped in favour of something like TclpOpenTemporaryFile, or fixed to call the same, flexible tempdir function DefaultTempDir() (currently unix, but should be ppromoted to platform-agnostic).
User Comments:
dkf added on 2012-11-11 16:54:05:
Causing problems for people using Tcl to develop on iOS, so needs regularization of this code (which is currently triplicated...)

dkf added on 2012-11-14 20:02:15:
Fix will be substantively different on 8.5 and 8.6 (as 8.6 has more machinery here); prioritizing 8.6 fix first.

dkf added on 2012-11-14 20:03:22:
Fix will be substantively different on 8.5 and 8.6 (as 8.6 has more machinery here); prioritizing 8.6 fix first.

dkf added on 2012-11-14 20:03:50:

IP - Comment Removed: 216.80.59.144

dkf added on 2012-11-14 21:38:34:

allow_comments - 1

Fixed on all production branches.

Now respects TMPDIR environment variable, and the default fallback (if that isn't provided and P_tmpdir isn't writable) can be set via the TCL_TEMPORARY_FILE_DIRECTORY preprocessor symbol (which needs to be a string constant).