Created
June 7, 2012 19:20
-
-
Save Linux-cpp-lisp/2890984 to your computer and use it in GitHub Desktop.
Basic Sandboxing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("timeout") | |
t=Thread.new(codeStr) do |code| | |
$SAFE=4 | |
Timeout::timeout(5) {eval code} rescue nil | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment