Skip to content
Tcl Source Code History Of Ticket 961646
Login

History Of Ticket 961646

Artifacts Associated With Ticket 961646

  1. Ticket change [4ee3dfbbb1] (rid 125727) by dgp on 2004-05-27 15:36:01:

    1. assignee initialized to: "vincentdarley"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      % glob *
      file
      % open noSuchDir/../file
      couldn't open "noSuchDir/../file": no such file or
      directory
      % open [file normalize noSuchDir/../file]
      file3
      
      Here [file normalize] converts
      "noSuchDir/../file" to "file", but
      and [open] on one fails, the  other
      succeeds.
      
      I think of [file normalize] giving me
      the preferred name among many
      names for one file.  Here it is
      convering a string that names no
      file into one that does name a file.
      
      This suggests that /../ interpretation
      is Tcl_Filesystem-specific and
      ought to be done in each Tcl_Filesystem's
      Tcl_FSNormalizePathProc rather
      than in the core FS layer.
      
    4. foundin initialized to: "obsolete: 8.5a2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "37. File System"
    10. title initialized to: "[file normalize] changes file reference"
    11. type initialized to: "Bug"
  2. Ticket change [10cc19a700] (rid 95023) by vincentdarley on 2004-05-27 22:50:02:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      An alternative interpretation is that 'open' on Unix has a
      bug.  For example:
      
      % file exists noSuchDir/../file
      1
      
      works just fine.  (And on Windows your 'open' example works
      fine too)
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  3. Ticket change [a069cb4935] (rid 96809) by dgp on 2004-05-28 00:14:55:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      % file exists noSuchDir/../file
      0
      % file exists [file normalize noSuchDir/../file]
      1
      
      The interpretation of /../ is filesystem dependent.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  4. Ticket change [c6759887ae] (rid 121772) by vincentdarley on 2004-06-02 21:27:58:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      I still tend to think this illustrates a bug in Tcl
      somewhere, since the above behaviour is not expected.  I now
      think it's due to some of the fs-optimization that was
      performed.  In particular, I think it's due to the 'if'
      block here in NativeCreateNativeRep:
      
          if (tsdPtr->cwdClientData != NULL) {
              /* The cwd is native */
      validPathPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr);
          } else {
      /* Make sure the normalized path is set */
      validPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr);
      Tcl_IncrRefCount(validPathPtr);
          }
      
      try making that 'if (0)' and see if the problem goes away.
      
      --
      
      Now, it's a separate issue as to what the desired behaviour
      is.  I see arguments for both approaches, really.  In
      particular, if, as you suggest the /../ interpretation is
      moved to the filesystem-specific layer (vastly complicating
      all filesystems), what behaviour should 'file normalize'
      have in this case?  How should 'file normalize' be documented?
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  5. Ticket change [7d6d4fc87a] (rid 164255) by dgp on 2018-06-28 19:06:41:

    1. assignee changed to: "aku"
    2. closer changed to: "nobody"
    3. comment changed to:
      % glob *
      file
      % open noSuchDir/../file
      couldn't open "noSuchDir/../file": no such file or
      directory
      % open [file normalize noSuchDir/../file]
      file3
      
      Here [file normalize] converts
      "noSuchDir/../file" to "file", but
      and [open] on one fails, the  other
      succeeds.
      
      I think of [file normalize] giving me
      the preferred name among many
      names for one file.  Here it is
      convering a string that names no
      file into one that does name a file.
      
      This suggests that /../ interpretation
      is Tcl_Filesystem-specific and
      ought to be done in each Tcl_Filesystem's
      Tcl_FSNormalizePathProc rather
      than in the core FS layer.
      
    4. icomment:
      
      The rules of path resolution by linux system calls are spelled out here.
      
        http://man7.org/linux/man-pages/man7/path_resolution.7.html
      
      According to them, Tcl needs to pass the "/.." substrings of things
      like /path/to/../foobar to the system calls intact to get them processed
      properly against the state of the filesystem. Lexical shortening due to
      "normalization" or for whatever other reasons lurk in the core of
      Tcl filesystem operations to pass /path/foobar instead are incorrect.
      
      That is, they create a system where the meaning of paths in Tcl are
      demonstrably inconsistent with the meaning of paths on the platform
      itself.  If Tcl really does mean to intentionally be different, that
      needs a lot more explanation and spelling out.  I think it's just a
      broken implementation.
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. severity changed to: "Minor"