Overview
| Artifact ID: | 159c0fedd100141c85e2e2f7626acbe59c7762be |
|---|---|
| Ticket: | 2917673fffffffffffffffffffffffffffffffff
Behavior of Safe Base |
| User & Date: | johannes-kuhn on 2012-05-31 19:00:57 |
Changes
- icomment:
This is more or less a general problem, introduced with safe base's compatibility for tm packages, that have never been solved. Currently a problem is that you could load a tm module called tcl::chan::fifo as chan::fifo. That means there are the following problems: 1) The same file can be accessed by different paths, like $p(:0:)/foo/bar.tcl and $p(:1:)/bar.tcl This means that the directory structure is not protected. 2) If I want to allow a safe interp to access a given directory, I usually need [file] (no problem, the new have to be compatible with the normal safe [file] command), [open] (not exposed) and [glob]. Writing a compatible [glob] is only possible with introspection ([interp alias $slave glob]) or other complex techniques. I see 2 possible solutions: 1) TM modules could be searched by the parent. This means that non-tm modules can only be loaded if they are in the access path. This is also what the documentation states. In this approach, [glob] is not longer needed in the safe base. 2) expose the entire directory structure. I have written such a replacement for the safe base, the api is not complete yet, but I'm already using it productive. http://johannes13.de/svn/john-tools/safe.tcl It is broken on Tcl 8.6b2.
- login: "johannes-kuhn"
- mimetype: "text/plain"
- username: "johannes-kuhn"