Skip to content
Tcl Source Code History Of Ticket cc1fabcb10f74c40
Login

History Of Ticket cc1fabcb10f74c40

Artifacts Associated With Ticket cc1fabcb10f74c40

  1. Ticket change [4b4548b3a8] (rid 234881) by sebres on 2024-11-08 00:13:03:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized 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 initialized to: "any"
    6. is_private initialized to: "0"
    7. login: "sebres"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "50e9528765c18296566374b3fde2df942c394efd"
    10. resolution initialized to: "None"
    11. severity initialized to: "Severe"
    12. status initialized to: "Open"
    13. submitter initialized to: "sebres"
    14. subsystem initialized to: "36. Pathname Management"
    15. title initialized to:
      windows: file join, file normalize (and/or Tcl_FSGetTranslatedPath) behave incorrect by translation to parent dir for root of samba path
      
    16. type initialized to: "Bug"
  2. Ticket change [621fa8a28f] (rid 234882) by oehhar on 2024-11-08 07:30:35:

    1. icomment:
      Great observation, Sebres, as always.
      
      Perhaps remove the spurious "]" from the last example:
      
      <verbatim>
      % 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
      </verbatim>
      
      I can confirm on 8.6.
      
      Thank you,
      Harald
      
    2. login: "oehhar"
    3. mimetype: "text/x-fossil-wiki"
    4. username: "oehhar"
  3. Ticket change [0c7a741186] (rid 234883) by juliannoble2 on 2024-11-08 09:11:21:

    1. icomment:
      For the first case of an ordinary UNC path - I wouldn't expect it to backtrack beyond the share name either using .. or file dirname.
       
      - On my windows system it doesn't in either cmd.exe or powershell.
      
      For the case of Dos device paths:
       //./  //?/  //./UNC/server/share //?/UNC/server share - it seems to natively backtrack as far as you like - so as I see it, that's the part that Tcl behaviour doesn't match.
      
    2. login: "juliannoble2"
    3. mimetype: "text/plain"
  4. Ticket change [beb7debf09] (rid 234884) by juliannoble2 on 2024-11-08 09:26:34:

    1. icomment:
      see also: https://core.tcl-lang.org/tcl/tktview/d8f12171564f57c9ed3c
      
      In particular the //./ syntax isn't fully supported anyway
      
      %file normalize //./c:/windows
      //./c:windows
      
      The //?/ syntax happens to work in this case - but it has other issues as shown in the above ticket.
      
      %file normalize //?/c:/windows
      //?/c:/windows
      
    2. login: "juliannoble2"
    3. mimetype: "text/plain"
  5. Ticket change [50503150d1] (rid 234900) by pooryorick on 2024-11-08 12:01:00:

    1. icomment:
      I believe the current behaviour is the correct before.  ".." is a synonym for "the parent directory", and the parent directory of the root directory is the root directory.
      
    2. login: "pooryorick"
    3. mimetype: "text/x-fossil-wiki"
  6. Ticket change [a9cba6f931] (rid 234901) by juliannoble2 on 2024-11-08 12:58:55:

    1. icomment:
      >I believe the current behaviour is the correct before. ".." is a synonym for "the parent directory", and the parent directory of the root directory is the root directory.
      
      Yes... or in Microsofts terminology - the server and share make up the 'volume' which can't be navigated beyond.
      ie the following is correct
        % file dirname //server/share
        //server share
      
      //server/share/etc is an ordinary UNC path with volume //server/share/
      //?/UNC/server/share/etc is a device UNC path with volume //?/UNC/server/share/ 
      
      //?/c:/ is a dos device path with volume //?/c:/
      
      (where technically forwardslashes are backslashes)
      
      As an added microsoft twist - the windows API documentation suggests that you can't navigate beyond the volume - but it seems that cmd.exe and powershell may process ".." segments before passing to the API - so some commandline tests can be misleading.  Presumably it's the API behaviour we want to be consistent with.
      
    2. login: "juliannoble2"
    3. mimetype: "text/plain"
  7. Ticket change [4b2ab0f9d1] (rid 234902) by juliannoble2 on 2024-11-08 13:00:25:

    1. icomment:
       correction:
       % file dirname //server/share
        //server/share
      
    2. login: "juliannoble2"
    3. mimetype: "text/plain"
  8. Ticket change [60d29cd451] (rid 234954) by jan.nijtmans on 2024-11-11 11:58:10:

    1. icomment:
      There is special processing for this case:
      
      [https://core.tcl-lang.org/tcl/file?name=generic/tclPathObj.c&ci=95b4578597ed8b7a&ln=179-187]
      
      Which means that in the case of UNC paths, the first two components cannot be separated.
      
      Conclusion: This is expected behavior.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  9. Ticket change [1b0ef5ddd8] (rid 235074) by jan.nijtmans on 2024-11-13 21:58:42:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2460628.41576876"
    3. closer changed to: "jan.nijtmans"
    4. login: "jan.nijtmans"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"