Jump to content

Untrusted environment: Difference between revisions

Line 50:
print FILE "Modifying an arbitrary file\n";
close FILE;</lang>
 
=={{header|Racket}}==
The <tt>racket/sandbox</tt> library provides a way to construct limited evaluators which are prohibited from using too much time, memory, read/write/execute files, using the network, etc.
<lang racket>
#lang racket
(require racket/sandbox)
(define e (make-evaluator 'racket))
(e '(...unsafe code...))
</lang>
The idea is that a default sandbox is suitable for running arbitrary code without any of the usual risks. The library can also be used with many different configurations, to lift some of the restriction, which is more fitting in different cases.
 
=={{header|Ruby}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.