Hi Jeff,
tried your idea of a secure script execution without the need for
random word generation:
secure-do: func [
{secure script execution}
untrusted [block! file! string!] {untrusted script}
security [block! word!] {specify net/file policy}
protected [block!] {words to protect}
/local my-words my result
] [
; create a temporary storage for system/words
my-words: make system/words []
; converts words to my words
my: func [words] [bind words in my-words 'system]
; file and net security
security: do reduce ['secure security]
; protect Secure and Secure-do at least
protected: bind union protected [secure secure-do] 'system
do compose/deep [
; protect words
unset protected
; do untrusted script
(my [if error? set/any]) 'result (my 'try) :untrusted [
result: disarm :result
]
; restore the words
(my 'foreach) word protected [
(my [set/any word get/any in]) my-words word
]
]
; restore file/net security
do reduce ['secure security]
get/any 'result
]
{
example:
secure-do [1 / 1] 'throw []
}
>
> Crazy, no? With REBOL you can be very possesive about your
> words. No, they're MY words! :-)
>
> What a swell language...
>
> -jeff
>
There may be some problems with GC, I think. GC corrections should
take this situation into account...
Ladislav