Skip to content
Tcl Source Code History Of Ticket 1835292fff
Login

History Of Ticket 1835292fff

Artifacts Associated With Ticket 1835292fff

  1. Ticket change [2b316f00cb] (rid 118701) by kjnash on 2007-11-20 18:05:36:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized 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 initialized to: "obsolete: 8.5b2"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "kjnash"
    10. subsystem initialized to: "20. [interp]"
    11. title initialized to: "Safe interp problems with namespaces and ensembles"
    12. type initialized to: "Bug"
  2. Ticket change [a76b171c0a] (rid 98792) by dgp on 2008-03-12 03:10:30:

    1. icomment:
      Logged In: YES 
      user_id=80530
      Originator: NO
      
      
      The difficulties with
      [interp hide] and namespaces
      make this a hard one, but the
      issue raised looks pretty serious.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. priority changed to: "8"
    5. username: "dgp"
  3. Ticket change [01b9df17a9] (rid 119534) by dkf on 2009-07-29 20:27:45:

    1. icomment:
      We ought to re-evaluate how safe.tcl works
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [5582e6210a] (rid 94145) by kjnash on 2009-07-30 19:10:08:

    1. icomment:
      Perhaps we could discuss this at Tcl 2009 - how about a BoF session for safe interpreters?
      
      
      
    2. login: "kjnash"
    3. mimetype: "text/plain"
    4. username: "kjnash"
  5. Ticket change [2d7464888a] (rid 119072) by kjnash on 2009-07-30 19:23:41:

    1. foundin changed to: "obsolete: 8.5.7"
    2. icomment:
      Re-assigned to 8.5 current (previously 8.5b2)
      Items (2) and (3) were bugs in 8.5b2 that have now been fixed.  (1) is an observation. (4) is a design issue that is still unresolved.
      
      
    3. login: "kjnash"
    4. mimetype: "text/plain"
    5. username: "kjnash"
  6. Ticket change [0922fd0fc9] (rid 89667) by dgp on 2009-07-30 21:32:57:

    1. icomment:
      
      The issues in this report are important, and deserve
      some attention.  Unless I'm missing something, though,
      they have nothing at all to do with the "Safe Base" in
      safe.tcl.
      
      I have no enthusiasm at all for examining safe.tcl.
      It feels like a failed an abandoned experiment to
      me, and a waste of time continuing any CPR on it.
      
      The issue that ensemblification has exposed
      unsafe commands in safe interps, and that
      Tcl_HideCommand()'s insistence on remaining
      namespace-unaware makes it near impossible
      to fix needs some resolution.  Conference is
      likely a good time to hold some feet to the fire.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  7. Ticket change [2cd943847b] (rid 118981) by dkf on 2009-07-30 21:35:21:

    1. icomment:
      When ensemblifying, I've been trying to make sure that I maintain the existing profile of what is and isn't safe. I've not done [file] or [encoding] yet.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  8. Ticket change [45ec3690ca] (rid 99427) by dkf on 2009-07-30 21:37:03:

    1. icomment:
      BTW, the ensembles themselves probably ought to be all safe; it's the subcommands that are potentially unsafe.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  9. Ticket change [41dbbacc4d] (rid 116263) by dgp on 2009-10-02 03:31:39:

    1. priority changed to: "9 Immediate"
  10. Ticket change [4779eaaae8] (rid 99713) by dgp on 2009-10-30 04:32:51:

    1. icomment:
      
      Issues here are tricky enough, I can't
      justify making 8.5.8 release wait for their
      resolution.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  11. Ticket change [ec27859d58] (rid 103664) by dgp on 2009-10-30 04:32:52:

    1. priority changed to: "8"
  12. Ticket change [2d56f0228b] (rid 119049) by dkf on 2012-05-31 16:36:17:

    1. icomment:
      [interp create -safe] currently hides all commands that are considered to default to not being safe, according to a fairly restrictive definition. The [info] command exists, but some of its subcommands are excluded. The [file] command is hidden by default, but some of its subcommands (the safe ones!) are actually present. The vast majority of [info] subcommands are *totally* safe.
      
      [safe::interpCreate] goes further, adding a profile of commands that permits requiring of packages from blessed directories. This entails adding special versions of many commands that are generally unsafe (and I *hate* the complexity of [glob]!)
      
      Re (1), I simply don't care. Or rather, broken old assumptions were always broken; there was simply never a promise to have only the global namespace present by default. Re (4), this is unfortunate but how it is. What we had previously was a horrible mess. It's still pretty messy, but at least we're trying to clean up the problems. THIS WILL BREAK SOME CODE. Can't be helped.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  13. Ticket change [715a29d1c9] (rid 100659) by kjnash on 2012-05-31 18:57:38:

    1. icomment:
      I agree that we shouldn't worry about (1), though we can lament the passing of a simpler age!
      
      (4) is more interesting.  At present, hidden commands must be in the global namespace.  At the BOF at Tcl 2009, I think it was stated that this problem is fixable.  It would be necessary to have a separate table of hidden commands for each namespace; and when a hidden command is exposed, although it could be given another name, it would have to be a name in the same namespace.
      
      IIRC, it was Kevin Kenny who had the most knowledge in this area.
      
      interp(n) states "Currently, the names of hidden commands cannot contain namespace qualifiers, and you must first rename a command in a namespace to the global namespace before you can hide it. Commands to be hidden by interp hide are looked up in the global namespace even if the current namespace is not the global one. This prevents slaves from fooling a master interpreter into hiding the wrong command, by making the current namespace be different from the global one."
      
      If anyone understands what the writer means by the final sentence, or can provide an example of this hypothetical attack, please speak up!  Until then, I'm not sure I believe this sentence.
      
      
    2. login: "kjnash"
    3. mimetype: "text/plain"
    4. username: "kjnash"