Overview
| Artifact ID: | d000413b6b4440777f11fd11363346fdf1563d76 |
|---|---|
| Ticket: | 3027815fffffffffffffffffffffffffffffffff
Safe interpreters can use Thread to execute unsafe commands |
| User & Date: | kjnash on 2010-07-13 23:35:26 |
Changes
- icomment:
> Interesting point. Actually I could ask Tcl_IsSafe(interp) of the > interp that creates the thread (the one that calls thread::create) > and inherit that state in the new thread so its interp is also safe. > Would that make sense? That's an interesting suggestion! However, file/network interaction is normally added to a safe interpreter either by [interp alias] or by sharing sockets: in both cases the slave is configured by its master (or higher ancestor) in the same thread. If there is no unsafe master, the slave would be of limited value, except for computation. If the Thread package were to add new mechanisms for using safe interpreters, I think it would create a lot of work for the developers of the Thread package, in particular the need to always be thinking about whether Thread facilities will allow a safe interpreter to execute commands in an unsafe interpreter (or, as Donal mentioned, a different kind of safe interpreter). However, such new mechanisms in Thread would not add much benefit, because safe interpreters are not widely used, and users will tend to use the safe-interpreter commands that they know, and will probably avoid using the new capabilities in Thread because any extra capabilities will introduce additional complications and security risks. Also, as far as I know, it is unprecedented to have a safe interpreter as the the root interpreter of a thread or process. I don't know if it would break anything. It would impact on development of the core, because the core developers would always have to consider the possibility that the root interpreter may be safe. I think the best solution is to remove the safe entry point Thread_SafeInit completely. As Donal said, let the master expose (safe) aliases to operations as necessary. Keith.
- login: "kjnash"
- mimetype: "text/plain"
- username: "kjnash"