Overview
| Artifact ID: | 111d5ff19d66b1acc3074d553cb687aa5435762a |
|---|---|
| Ticket: | 8527d8becf29df06d2563a2abde5983043285f18
Commands cd, glob and normalize may fail on Windows if used with network locations containing NTFS junctions |
| User & Date: | mfriedrich on 2016-03-02 21:29:24 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
On Windows, it seems if paths are used which point to network locations. and those network locations contain junctions, then Tcl resolves those junctions, but should not. Those junctions always point to drives on the server. Tcl treats them as local drives, which they are not. To test: On a Windows server (must not be the same as the below Windows client): * add a new drive/partition, format as NTFS and give it the letter P * create this folder structure: P:\Share\Bar\subdir * create a junction: P:\Share\Foo pointing to --> P:\Share\Bar * create a dummy file: P:\Share\Bar\subdir\dummy.txt * create local user "user" with password "password" * share the folder P:\Share as ShareOnDriveP for user "user" full access On the Windows client/workstation side with a Tcl installation: * mount the network share as drive M: net use m: \\server\ShareOnDriveP /user:server\user password * make sure you have no local drive with letter P * run this on tclsh.exe set result 0 puts "M:/Foo/subdir=[file normalize M:/Foo/subdir]" puts "M:/Bar/subdir=[file normalize M:/Bar/subdir]" puts "\n" if {[catch { cd M:/Bar/subdir set dir [pwd] if {$dir ne "M:/Bar/subdir"} { puts stderr "test 1 failed" set result 1 } else { puts stderr "test 1 passed" } } status]} { puts stderr "test 1 failed\n$errorInfo" set result 1 } puts "\n" if {[catch { cd M:/Bar cd subdir set dir [pwd] if {$dir ne "M:/Bar/subdir"} { puts stderr "test 2 failed" set result 1 } else { puts stderr "test 2 passed" } } status]} { puts stderr "test 2 failed\n$errorInfo" set result 1 } puts "\n" if {[catch { cd C:/ set list [glob -directory M:/Bar/subdir -tail *] if {$list ne {dummy.txt}} { puts stderr "test 3 failed" set result 1 } else { puts stderr "test 3 passed" } } status]} { puts stderr "test 3 failed\n$errorInfo" set result 1 } cd C:/ file delete C:/test-link file delete -force C:/test-target exit $result It produces the output: M:/Foo/subdir=M:/Foo/subdir M:/Bar/subdir=/Bar/subdir test 1 failed couldn't change working directory to "M:/Bar/subdir": no such file or directory while executing "cd M:/Bar/subdir" test 2 passed test 3 failed couldn't read directory "/Bar/subdir/*": no such file or directory while executing "glob -directory M:/Bar/subdir -tail *" - foundin changed to: "8.6.4.1"
- is_private changed to: "0"
- login: "mfriedrich"
- priority changed to: "5 Medium"
- private_contact changed to: "a3e196ae61223ed094178305110e4d1d8ccbac2b"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "mfriedrich"
- subsystem changed to: "36. Pathname Management"
- title changed to:
Commands cd, glob and normalize may fail on Windows if used with network locations containing NTFS junctions
- type changed to: "Bug"