Skip to content
Tcl Source Code History Of Ticket 8527d8bec
Login

History Of Ticket 8527d8bec

Artifacts Associated With Ticket 8527d8bec

  1. Ticket change [111d5ff19d] (rid 145170) by mfriedrich on 2016-03-02 21:29:24:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized 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 *"
      
    5. foundin initialized to: "8.6.4.1"
    6. is_private initialized to: "0"
    7. login: "mfriedrich"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "a3e196ae61223ed094178305110e4d1d8ccbac2b"
    10. resolution initialized to: "None"
    11. severity initialized to: "Important"
    12. status initialized to: "Open"
    13. submitter initialized to: "mfriedrich"
    14. subsystem initialized to: "36. Pathname Management"
    15. title initialized to:
      Commands cd, glob and normalize may fail on Windows if used with network locations containing NTFS junctions
      
    16. type initialized to: "Bug"