Re: Restricting execution of the tcl script to a folder or below
- From: fpgabuilder <fpgabuilder-groups@xxxxxxxxx>
- Date: Fri, 31 Aug 2007 15:41:24 -0000
On Aug 31, 8:02 am, ican...@xxxxxxxxx wrote:
On Aug 31, 3:33 am, skuha...@xxxxxx wrote:
Hello
Now I can see a lot of resources to setup the communication. What I do
not know is how can I prevent accidental or rogue script from causing
damage to the files outside of the folder from which it is supposed to
execute. Is this even possible?
Yes, you should read about "Safe Base" here:http://www.tcl.tk/man/tcl8.4/TclCmd/safe.htm
It allows you to create a safe interpreter as an environment for
exactly this purpose. With "-accessPath directoryList" you can
restrict from where [source] and [load] can use files. Also the safe
interpreter created with "Safe Base" can be configured to see only Tcl
commands, that you allow it to see. If you don't want any file-access,
you simply remove all [file], [open] and others from the interpreter
before executing the script. You can even replace [ope]/[read]/[write]
with your own guarded implementations, so that the executed script can
use those commands, but only in a way you allow it.
I think, this should perfectly match your needs.
HTH
Stephan
Armed with the safe interpreter you might want to look at the sample
tclet code associated with the SIMPL project to facilitate the
"sending the result back" portion of your problem.
https://sourceforge.net/projects/simplhttp://users.netrover.com/~ican/simpl
In particular you might want to look at the browserless applet example
in my recent SIMPL presentation to a local LUG in town.
http://www.icanprogram.com/hosug
If you need further help with this stuff, contact me offline and I'll
be glad to share my expertise.
bob
Stephan, Bob,
Thank you for the pointers. Yes! Looks like the safe base will do
everything that I want. Awesome!
.
- References:
- Restricting execution of the tcl script to a folder or below
- From: fpgabuilder
- Re: Restricting execution of the tcl script to a folder or below
- From: skuhagen
- Re: Restricting execution of the tcl script to a folder or below
- From: icanbob
- Restricting execution of the tcl script to a folder or below
- Prev by Date: Re: Restricting execution of the tcl script to a folder or below
- Next by Date: expect hangs at "\# "
- Previous by thread: Re: Restricting execution of the tcl script to a folder or below
- Next by thread: PSPAD + ramdebugger
- Index(es):
Relevant Pages
|