Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2012-11-14
21:38 • Closed ticket [2933003fff]: Non-configurable tempdir for child stderr plus 7... artifact: 3b78cfac84 user: dkf
20:03 • Ticket [2933003fff]: 4 changes artifact: f5b35c88ae user: dkf
20:03 • Ticket [2933003fff]: 4 changes artifact: 103c87455a user: dkf
20:02 • Ticket [2933003fff]: 4 changes artifact: 814a87bd29 user: dkf
2012-11-11
16:54 • Ticket [2933003fff]: 7 changes artifact: a10f57574c user: dkf
2010-01-15
17:48 • New ticket [2933003fff]. artifact: c71955d4f4 user: ferrieux

Non-configurable tempdir for child stderr

Closed / Fixed2933003fffffffffffffffffffffffffffffffffCreated 17 years agoUpdated 14 years ago
Descriptionplain2010-01-15 17:48:11
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).
dkfplain2012-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...)
dkfplain2012-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.
dkfplain2012-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.
dkfplain2012-11-14 20:03:50
IP - Comment Removed: 216.80.59.144
dkfplain2012-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).
Log in (anonymous is fine) to add a comment.