Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 63d9c0d260489b96db11c0c1c88f352aa7137df4
Ticket: 2854929fffffffffffffffffffffffffffffffff
Cannot load Tcl modules with :: in Safe Base interpreters
User & Date: apnadkarni on 2009-09-09 05:18:32
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Logging this as per Andreas Kupries' direction on c.l.t.
    Tried on XP, using Active Tcl 8.6b1.1
    -------
    I've run into an issue with loading Tcl modules into interpreters
    created with ::safe::interpCreate. I'm not sure whether this is by
    design or a bug. The following piece of code executes without errors
    
    set ip [::safe::interpCreate]
    $ip eval {package require uri}
    
    (uri is a package in tcllib, as is uri::urn)
    
    The following errors out
    $ip eval {package require uri::urn}
    
    The uri package is loaded from C:/Tcl/lib/teapot/package/tcl/teapot/
    tcl8/8.2/uri-1.2.1.tm whereas
    the uri::urn package is loaded from C:/Tcl/lib/teapot/package/tcl/
    teapot/tcl8/8.4/uri/urn-1.0.2.tm
    The issue is that the Tcl module loading system maps a package name
    containing :: to subdirectories and while the safe interpreter's -
    accessPath contains the .....tcl8/8.2 directory, it does not contain
    the subdirectory (uri). Consequently, any Tcl modules with :: in the
    package name fail to load.
    
    The question is - is this by design or an oversight ? What is the
    danger (from a security perspective) to allow recursion if the
    directory path matches the path in the package name?
    
    /Ashok
    
  4. foundin changed to: "obsolete: 8.6b1.1"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "apnadkarni"
  10. subsystem changed to: "33. Safe Base"
  11. title changed to:
    Cannot load Tcl modules with :: in Safe Base interpreters
    
  12. type changed to: "Bug"