Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 80a2b7670c79483b698ae54a24a215237505f0f8fdba35872daf70d79b94de47
Ticket: 41c9857bdd2d137b9130deb6704be15e159e4765
library/init.tcl adds nonsense to auto_path in Safe Base interpreters
User & Date: kjnash on 2020-06-23 17:28:45
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    (I will patch the code myself shortly - this ticket is for reference.)
    
    Bug in library/init.tcl for Safe Base interpreters.
    
    The file library/init.tcl is sourced into the main interpreter, unsafe slave interpreters, and Safe Base slave interpreters.
    
    The file is not sourced into safe slave interpreters created by [interp create -safe foo].  In a Safe Base interpreter, the file is sourced by ::safe::interpCreate after it creates the safe slave.
    
    In a Safe Base interpreter, the elements of ::auto_path must be the tokenized directory names, e.g. {$p(:42:)}.  The Safe Base interpreter is unable to use real directory names, and such information should not leak into the interpreter in any case.
    
    The current library/init.tcl permits such leakage.  It appends the list elements . ./lib to ::auto_path.
        . is added as [file dirname $::tcl_library]
        ./lib is added as [file join [file dirname [file dirname [info nameofexecutable]]] lib]
    
    The best fix is not to allow safe interpreters to execute the code that sets auto_path in library/init.tcl.  For a Safe Base slave interpreter, responsibility for initializing ::auto_path rests with the Safe Base and with the caller of ::safe::interpCreate, not with library/init.tcl.
    
  5. foundin changed to: "8.6 and above"
  6. is_private changed to: "0"
  7. login: "kjnash"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "a774b1f5653dc3360e29ea7d635a64e94c9f1dab"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "kjnash"
  14. subsystem changed to: "38. Init - Library - Autoload"
  15. title changed to:
    library/init.tcl adds nonsense to auto_path in Safe Base interpreters
    
  16. type changed to: "Bug"