Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2b316f00cbf1d2ea4f9c19483917aacd65f04430
Ticket: 1835292fffffffffffffffffffffffffffffffff
Safe interp problems with namespaces and ensembles
User & Date: kjnash on 2007-11-20 18:05:36
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    (Using 8.5b2 for Linux x86)
    
    (1) Existence of namespaces
    In 8.4, a freshly created safe interpreter has no namespaces apart from "::".
    However, in 8.5b2, a freshly created safe interpreter has "::tcl" and its children.
    This might not be inherently unsafe, but it certainly breaks assumptions that were valid in 8.4.
    
    (2) The namespace ensemble command chan is not one of the safe commands, but it is not listed in the hidden commands either.
    
    % interp create -safe -- bar
    bar
    %
    % interp eval bar {info commands c*}
    case catch clock concat close continue
    %
    % interp eval bar {chan}
    invalid command name "chan"
    %
    % interp hidden bar
    file socket open pwd glob exec encoding load fconfigure source exit cd
    %
    
    (3) More trouble with chan: exposure of its member commands.
    All the commands ::tcl::chan::* are exposed, but ::chan is not one of the safe commands.
    
    (4) Hiding a namespace ensemble command
    The commands ::tcl::Info_* are exposed, even if ::info is hidden.  At best, it is laborious to hide an ensemble command; at worst, you might not realize that the command is an ensemble with members in a namespace, that also need to be hidden.
    
    % interp create -safe -- foo
    foo
    % interp eval foo {info commands i*}
    info if interp incr
    % interp hide foo info
    % interp eval foo {info commands i*}
    invalid command name "info"
    %
    % interp eval foo {::tcl::Info_commands i*}
    if interp incr
    %
    
    
  4. foundin changed to: "obsolete: 8.5b2"
  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: "kjnash"
  10. subsystem changed to: "20. [interp]"
  11. title changed to: "Safe interp problems with namespaces and ensembles"
  12. type changed to: "Bug"