Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a3358c55a4314e2b3c8f9c00ecfc12517e33641d
Ticket: 402924ffffffffffffffffffffffffffffffffff
Fix for race condition in unix/tclUnixPipe.c
User & Date: rmax on 2001-03-29 13:13:54
Changes

  1. icomment:
    Logged In: YES 
    user_id=124643
    
    It is only a very tight race condition, but it exists. If
    someone creates a symlink in the time between tmpnam() and
    open() that has the same name as the temporary file you are
    about to open, the target file of this symlink will be
    deleted, if open is called with O_TRUNC.
    
    Adding O_NOFOLLOW instead of replacing O_TRUNC with O_EXCL
    may also help, but seems to be less portable.
    
    BTW, the manpage of tmpnam says: 
    BUGS
           Never use this function. Use mkstemp(3) instead.
    
    
    
  2. login: "rmax"
  3. mimetype: "text/plain"
  4. username: "rmax"