| Donal K. Fellows 2006-12-23, 10:05 pm |
| vkrajan@gmail.com wrote:
> My question: how do I load shared libraries if load has been disabled
> inside my executable. Are there any tricks to pre-load the shared
> library with some special system-level environment variables?
The existence of such "tricks" would constitute a significant security
hole, and as such, no[*] such tricks exist; without the [load] command,
the only way to introduce new commands into an interpreter involves
relinking the binary. (System variable tinkering can be used to load an
alternate shared library, but they get loaded at a stage when the
interpreter structure doesn't exist, making plugging into them more than
a bit difficult).
It might be better to farm out the computation which needs [load]ed code
into a separate Tcl interpreter started with [exec]...
Donal.
[* Or at least none that aren't totally gross, and probably in need of
deep coupling to the system you're running on. If you're going this
way, the key problem is working out how to get a trappable library
call that gives you access to the interpreter at a suitable time. ]
|