Hi,
In message "Re: $SAFE = 5 and Safe Ruby Misleading?"
on 03/08/13, Dave Fayram <kirindave / lensmen.net> writes:
|Basically, can I evaluate something in a $SAFE = 4 thread, then get it
|out and work with it meaningfully?
The untrusted thread can return value from it. For example,
def safe_eval(str)
Thread.start {
$SAFE=4
eval(str) # the last evaluated value
}.value # can be retrieved using "value" method
end
Besides, the thread can push data to the queue, then data is read by
the trusted code, validated, then output.
matz.