Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4b4548b3a8c6068be784742b94eb80c35d71b686b3f17565050deb405e81e22e
Ticket: cc1fabcb10f74c404f7992845c64f796e43fd27b
windows: file join, file normalize (and/or Tcl_FSGetTranslatedPath) behave incorrect by translation to parent dir for root of samba path
User & Date: sebres on 2024-11-08 00:13:03
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    Example:
    <code><pre>
        % file normalize [file join //host/former ../latter/.$tcl_platform(platform)]
        //host/former/latter/.windows
        % file join [file dirname //host/former] latter/.$tcl_platform(platform)
        //host/former/latter/.windows
    </pre></code>
    For windows it doesn't switch samba-share (must basically replace former with latter here), so it simply ignores ".."
    
    Expected (for both cases):
    <code><pre>
        //host/latter/.windows
    </pre></code>
    
    PoC, why it is definitely wrong (and deviates from native FS):
    <code><pre>
        % puts [set p [file join //?/d:/ ../c:/windows]]]\t[file normalize $p]\t[file exists $p]
        //?/d:/../c:/windows]   //?/d:/c:/windows       0
        % exec cmd /c "IF EXIST $p ECHO YES"
        YES
    </pre></code>
    So it looks like <code><i>Tcl_FSGetTranslatedPath</i></code> function has also the same issue, because of <code><i>file exists</i></code> wrong result (0).
    
  5. foundin changed to: "any"
  6. is_private changed to: "0"
  7. login: "sebres"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "50e9528765c18296566374b3fde2df942c394efd"
  10. resolution changed to: "None"
  11. severity changed to: "Severe"
  12. status changed to: "Open"
  13. submitter changed to: "sebres"
  14. subsystem changed to: "36. Pathname Management"
  15. title changed to:
    windows: file join, file normalize (and/or Tcl_FSGetTranslatedPath) behave incorrect by translation to parent dir for root of samba path
    
  16. type changed to: "Bug"