Overview
| Artifact ID: | 06f201323cff537271658277b617d56fcbedeab2 |
|---|---|
| Ticket: | 1048733fffffffffffffffffffffffffffffffff
possible segfaults with NULL interps |
| User & Date: | coldstore on 2004-10-17 16:36:45 |
Changes
- assignee changed to: "vincentdarley"
- cmimetype changed to: "text/plain"
- comment changed to:
FileCopyRename at ../generic/tclFCmd.c:539 calls Tcl_FSFileAttrsSet(NULL, 2, target, perm), passing a NULL Tcl_Interp* into the set attr command (presumably because the rename is being performed en passant) However, NativeFileAttrsSet() which is the default for normal file systems (and other set attribute handlers), can get errors - in my case in SetPermissionsAttribute at ../unix/tclUnixFCmd.c:1480, where a posix error occurs, and the code calls Tcl_PosixError(interp). The upshot is that Tcl_PosixError tries (eventually) to set errorCode and this fails because there is no interpreter (or, rather, a NULL interpreter) for it to set the variable in. You can reproduce this by creating a pair of files, A and B, owned by another user and (at least in my case) chmod u=rw,g=r,o=r Then, in tclsh8.5: file rename -force A B It SIGSEGVs because of the NULL interpreter. I suggest that the practice of passing NULL interp into functions which could generate errors is always bad, and in this case at least the call to Tcl_FSFileAttrsSet should pass in the variable interp, and not NULL.
- foundin changed to: "obsolete: 8.5a2"
- priority changed to: "7 High"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "coldstore"
- subsystem changed to: "37. File System"
- title changed to: "SIGSEGV on file rename when user doesn't own file"
- type changed to: "Bug"