Artifacts Associated With Ticket cdd157d484
Ticket change [c6f7400b3f] (rid 148102) by Tomo on 2016-07-18 14:52:40:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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. - foundin initialized to: "8.6"
- is_private initialized to: "0"
- login: "Tomo"
- priority initialized to: "5 Medium"
- private_contact initialized to: "22f396e0a6e1333adf623bf097fc096e9dc12cdd"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "Tomo"
- subsystem initialized to: "37. File System"
- title initialized to: "file copy -force does an invalid call to open"
- type initialized to: "Bug"
Ticket change [d85f222ec9] (rid 148143) by aspect on 2016-07-19 03:58:01:
- 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.
- login: "aspect"
- mimetype: "text/plain"
- icomment:
Ticket change [2ebe2930e9] (rid 148200) by Tomo on 2016-07-21 14:50:41:
- 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 ?
- login: "Tomo"
- mimetype: "text/plain"
- icomment:
Ticket change [95dab05d82] (rid 148241) by dkf on 2016-07-24 12:52:53:
- icomment:
We certainly shouldn't be setting the file type descriptor bits. There's literally no reason at all for handing those over.
- login: "dkf"
- mimetype: "text/html"
- icomment: