Skip to content
Tcl Source Code History Of Ticket 5af0b88de82204d1
Login

History Of Ticket 5af0b88de82204d1

Artifacts Associated With Ticket 5af0b88de82204d1

  1. Ticket change [7b9b069cb3] (rid 184971) by kjnash on 2020-07-18 12:57:09:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      In command ::safe::AliasGlob, the following code block in the [switch] command that parses command options fulfils no useful purpose and should be removed:
      <verbatim>
      	    pkgIndex.tcl {
      		# Oops, this is globbing a subdirectory in regular package
      		# search. That is not wanted. Abort, handler does catch
      		# already (because glob was not defined before). See
      		# package.tcl, lines 484ff in tclPkgUnknown.
      		return -code error "unknown command glob"
      	    }
      </verbatim>
      ::safe::AliasGlob was added in:
        *  file: [ec1bb9af3f] check-in: [7f54ff3bbe] 2008-06-25 core-8-5-branch
        *  file: [e245695909] check-in: [d5216b1efd] 2008-06-25 trunk
      
        *  AliasGlob was added so Safe Base interpreters could use tcl::tm modules via ::tcl::tm::UnknownHandler.
        *  The non-module package handlers, tclPkgUnknown and tcl::MacOSXPkgUnknown, also use glob (to search subdirectories of the auto_path elements) but expected it to fail in a Safe Base interpreter.
        *  From these first commits, AliasGlob included code that raised an error if argument "pkgIndex.tcl" was the first pattern element.  Comments refer to the wish to reject usage by tclPkgUnknown.  The motivation in these early stages was presumably to craft AliasGlob for use only in the ::tcl::tm::UnknownHandler.
        *  However, examination of tclPkgUnknown and tcl::MacOSXPkgUnknown shows that, by the time the code was committed in June 2008, the calls from tclPkgUnknown and tcl::MacOSXPkgUnknown would not have triggered the error because "pkgIndex.tcl" was not the first pattern element after the options.  The code block no longer served its original purpose.
      
      Retention of this [switch] block would be justified if it prevented abuse of the AliasGlob command by untrusted code.  However,
      
        #  The AliasGlob command is strict about allowing searches only in directories that belong to the access path, and there is no harm in allowing a search for "pkgIndex.tcl" there.
        #  A search for "pkgIndex.*", or even "*", is permitted and is harmless.
      
      The code is simply a relic of the early development of AliasGlob and no longer serves any useful purpose.
      
      Fixed in branch safe-bugfixes-8-6 commit [fb0d72aad4].
      
    5. foundin initialized to: "core-8-6-branch"
    6. is_private initialized to: "0"
    7. login: "kjnash"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "a774b1f5653dc3360e29ea7d635a64e94c9f1dab"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "kjnash"
    14. subsystem initialized to: "33. Safe Base"
    15. type initialized to: "Bug"
  2. Ticket change [aac1abd991] (rid 184972) by kjnash on 2020-07-18 12:57:52:

    1. login: "kjnash"
    2. mimetype: "text/plain"
    3. title changed to: "Remove redundant code from ::safe::AliasGlob"
  3. Ticket change [162bbff0c1] (rid 190593) by kjnash on 2020-12-31 16:03:26:

    1. closedate changed to: "2459215.16905153"
    2. closer changed to: "kjnash"
    3. login: "kjnash"
    4. mimetype: "text/plain"
    5. resolution changed to: "Fixed"
    6. status changed to: "Closed"