Skip to content
Tcl Source Code History Of Ticket cdd157d484
Login

History Of Ticket cdd157d484

Artifacts Associated With Ticket cdd157d484

  1. Ticket change [c6f7400b3f] (rid 148102) by Tomo on 2016-07-18 14:52:40:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      The following TCL command:
      
      file copy -force in.txt out.txt
      
      will produce this call to "open" syscall:
      
      open("out.txt", O_WRONLY|O_CREAT|O_TRUNC, 0100664) = 6
      
      We can see that beside the mode ("664") there is the S_IFREG flag (0100000, regular flag) which is set. According to open man page, there shouldn't be any other bit in "mode" than the permission bits (see http://man7.org/linux/man-pages/man2/open.2.html "According to POSIX, the effect when other bits are set in mode is unspecified...")
      
      I found that some filesystem doesn't like this bit to be set.
      
      I see that "file copy -force" do a stat on the file before doing the open and I suspect TCL to blindly reuse the flag gained by the stat command but it should only use the lower bits.
      
    5. foundin initialized to: "8.6"
    6. is_private initialized to: "0"
    7. login: "Tomo"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "22f396e0a6e1333adf623bf097fc096e9dc12cdd"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "Tomo"
    14. subsystem initialized to: "37. File System"
    15. title initialized to: "file copy -force does an invalid call to open"
    16. type initialized to: "Bug"
  2. Ticket change [d85f222ec9] (rid 148143) by aspect on 2016-07-19 03:58:01:

    1. icomment:
      > I suspect TCL to blindly reuse the flag gained by the stat command but it should only use the lower bits.
      
      This appears to be the case:
      
        http://core.tcl.tk/tcl/artifact/1b60acbf412a1ef8?ln=574
      
      This looks like the right place to mask the permissions parameter, but we should be careful.  To quote more fully from the Linux manual:
      
      > According to POSIX, the effect when other bits (than 0777) are set in
      > mode is unspecified.  On Linux, the following bits are also honored in
      > mode:
      
      (refers to mode & 07000 - setu/gid and sticky bits).
      
      Should [file copy] on Linux also copy these bits?  What about other unixes?
      
      This smells like one of those dusty under-specified corners of POSIX where
      the right thing for all platforms is not always going to be obvious.
      
    2. login: "aspect"
    3. mimetype: "text/plain"
  3. Ticket change [2ebe2930e9] (rid 148200) by Tomo on 2016-07-21 14:50:41:

    1. icomment:
      I would say that we can keep all bits in the 07777 mask. Upper bits are informative bits for stat command.
      
      It shouldn't break anything.
      
      What do you think ?
      
    2. login: "Tomo"
    3. mimetype: "text/plain"
  4. Ticket change [95dab05d82] (rid 148241) by dkf on 2016-07-24 12:52:53:

    1. icomment:
      We certainly shouldn't be setting the file type descriptor bits. There's literally no reason at all for handing those over.
      
    2. login: "dkf"
    3. mimetype: "text/html"