Artifacts Associated With Ticket 849514ffffffffff
Ticket change [7b83bdfd5b] (rid 96922) by vulpeculus on 2003-11-26 09:07:49:
- assignee initialized to: "vincentdarley"
- cmimetype initialized to: "text/plain"
- comment initialized to:
This concerns Tcl on Unix (Solaris 8, Solaris 9, RH Linux Kernel 2.4.?): When trying to open a file (e.g. [open $filename r]) with an absolute pathname containing symbolic links and ../ (parent directory), a wrong file is referenced: e.g. if /home/somedir is a link to /root/otherdir then trying to open /home/somedir/../file opens /home/file instead of /root/file In Tcl 8.3.1 open worked as expected. The first Tcl version which I can test and has the problem is 8.4.1
- foundin initialized to: "obsolete: 8.4.5"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "vulpeculus"
- subsystem initialized to: "36. Pathname Management"
- title initialized to: "Absolute pathnames with ../ and links"
- type initialized to: "Bug"
Ticket change [dc149dcf69] (rid 108066) by hobbs on 2003-11-27 01:00:11:
- closedate changed to: "2003-11-26T18:00:11"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 This works for me in 8.4.5 on linux: ln -s /tmp/dist /home/ tclsh % open /home/dist/../jeffh/.cshrc file4 So this should have been checked against the latest release before submitting.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Out of Date"
- status changed to: "Closed"
- username: "hobbs"
Ticket change [f424657836] (rid 129855) by vulpeculus on 2003-11-27 14:32:08:
- icomment:
Logged In: YES user_id=917954 The bug IS still ion 8.4.5. What I wanted to say that it probably first occured between 8.3.1 and 8.4.1. In your example /home/dist is a link to /tmp/dist So /home/dist/../jeffh/.cshrc is /tmp/jeffh/.cshrc, not /home/jeffh/.cshrc (try it e.g. with ls in any shell). However, as long as you do not have a file /tmp/jeffh/.cshrc, the open command from your example should return an error "no such file or directory", instead of opening the wrong file. The same behaviour can also be found with a non-existing directory in your pathname: open /home/jeffh/nonexistentdir/../.cshrc fails in 8.3.1 (correct), but succeeds in 8.4.5 (incorrect)
- login: "vulpeculus"
- mimetype: "text/plain"
- resolution changed to: "None"
- status changed to: "Open"
- username: "vulpeculus"
- icomment:
Ticket change [4d95d2fea4] (rid 127079) by vincentdarley on 2003-12-10 19:17:38:
- icomment:
Logged In: YES user_id=32170 This behaviour is all down to 'file normalize', so if this bug report is correct, you should be able to show that 'file normalize' returns the wrong path for some input strings containing ../ Can you please try to provide one or two examples?
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [0fd09cbb77] (rid 94858) by vincentdarley on 2003-12-10 19:22:57:
- icomment:
Logged In: YES user_id=32170 Here's a simple example on Windows: file mkdir tclfoo cd tclfoo file mkdir one/two/three file link link one/two/three file normalize link/../foo # The result: E:/tclfoo/foo # It should be: E:/tclfoo/one/two/foo
- login: "vincentdarley"
- mimetype: "text/plain"
- priority changed to: "7 High"
- username: "vincentdarley"
- icomment:
Ticket change [f183aafe43] (rid 109373) by vincentdarley on 2003-12-10 19:32:43:
- icomment:
Logged In: YES user_id=32170 The bug is quite clear now. TclFSNormalizeAbsolutePath removes all '.' and '..' sequences before passing the path to the platform-specific normalization code. But, the '..' removal is done in a purely string-based way, with no awareness of symlinks at all. We probably need to remove that whole block of code (lines 149-173 of tclPathObj.c) and make each platform-specific piece of code a bit cleverer. This might actually improve performance, since it would remove the need for a whole file split/file join pair in the current approach (but replace it with more complex platform-specific code).
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [68a9843124] (rid 103108) by vincentdarley on 2003-12-11 00:35:47:
- icomment:
File Added - 70181: linknorm.diff Logged In: YES user_id=32170 Please test the attached patch (to Tcl 8.5a0)
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [657e36cd48] (rid 102554) by vincentdarley on 2003-12-11 18:53:10:
- icomment:
File Deleted - 70181: File Added - 70242: linknorm.diff
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [ac78285779] (rid 101295) by vincentdarley on 2003-12-11 19:58:19:
- assignee changed to: "hobbs"
- icomment:
File Deleted - 70242: File Added - 70250: linknorm.diff Logged In: YES user_id=32170 Updated patch. Needs testing on unix, but should then be ready to go. Jeff: could you test this please?
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
Add attachment "linknorm.diff" [b05e439b1d] (rid 97967) by vincentdarley on 2003-12-13 00:30:23.
Ticket change [12849f1aa8] (rid 124044) by vincentdarley on 2003-12-13 00:30:23:
- icomment:
File Deleted - 70250: File Added - 70363: linknorm.diff Logged In: YES user_id=32170 Updated patch for cvs head.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [7d830e18e6] (rid 97254) by hobbs on 2004-02-06 09:37:31:
- icomment:
Logged In: YES user_id=72656 We will also need an 8.4-based patch.
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "hobbs"
- icomment:
Ticket change [54bddd6dbc] (rid 93996) by hobbs on 2004-02-18 08:37:35:
- closedate changed to: "2004-02-18T01:37:35"
- closer changed to: "hobbs"
- icomment:
Logged In: YES user_id=72656 backported for 8.4.6.
- login: "hobbs"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "hobbs"
Ticket change [3903b79ab9] (rid 112314) by hobbs on 2004-02-18 09:04:21:
- icomment:
Logged In: YES user_id=72656 had to revert because the changes were not properly isolated, and the 8.5 changes are a lot more spread out than expected. Don't know quite what to backport ...
- login: "hobbs"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "hobbs"
- icomment:
Ticket change [a625163740] (rid 98545) by hobbs on 2004-11-18 00:46:41:
- assignee changed to: "vincentdarley"
Ticket change [a4d368402e] (rid 110267) by dgp on 2004-11-18 01:31:12:
- icomment:
Logged In: YES user_id=80530 This matter is related to 961646. Both are rooted in the fact that Tcl's Tcl_Filesystem layer is imposing one interpretation of ".." in a path instead of leaving it up to each (native) filesystem to use its own preferences.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [48e2790f07] (rid 99967) by dgp on 2004-12-02 08:30:41:
- icomment:
Logged In: YES user_id=80530 dropping priority since this can't be "fixed" until the differences of opinion about the correct design of the VFS layer laid out in 961646 are addressed. this won't be fixed in Tcl 8.4.9.
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "7 High"
- username: "dgp"
- icomment:
Ticket change [024b76ed78] (rid 119619) by vincentdarley on 2004-12-03 01:18:26:
- icomment:
Logged In: YES user_id=32170 I don't know if I agree with dgp's comment that each filesystem should have its own interpretation of '..'. Surely they should be the same? (At least that's what's in Tcl 8.5)
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment: