#4518 Non-configurable tempdir for child stderr

obsolete: 8.5.12
closed-fixed
9
2012-11-14
2010-01-15
No

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).

Discussion

    • milestone: --> obsolete: 8.5.12
    • priority: 5 --> 9
    • assigned_to: vincentdarley --> dkf
     
  • Causing problems for people using Tcl to develop on iOS, so needs regularization of this code (which is currently triplicated...)

     
  • Fix will be substantively different on 8.5 and 8.6 (as 8.6 has more machinery here); prioritizing 8.6 fix first.

     
    • status: open --> closed-fixed
     
  • 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).