Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require './security_manager'
- java.lang.System.setProperty 'java.security.debug', 'access,failure'
- begin
- puts "Trying to install the security manager"
- java.lang.System.setSecurityManager FileSystemSecurityManager.new
- rescue => e
- puts "Exception: #{e.message}"
- end
- puts "Running unstrusted code now..."
- require File.join(File.expand_path('.'), 'sandbox/untrusted_code')
- # UPDATE: JRuby have some issues that allow users to run untrusted code that can access/ modify file system,
- # I'm planning to submit it issues to jruby team, so don't feel safe when using security manager to run ruby
- # code :(
Add Comment
Please, Sign In to add comment