Guest User

Untitled

a guest
Dec 11th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. require './security_manager'
  2.  
  3. java.lang.System.setProperty 'java.security.debug', 'access,failure'
  4.  
  5. begin
  6. puts "Trying to install the security manager"
  7. java.lang.System.setSecurityManager FileSystemSecurityManager.new
  8. rescue => e
  9. puts "Exception: #{e.message}"
  10. end
  11.  
  12. puts "Running unstrusted code now..."
  13. require File.join(File.expand_path('.'), 'sandbox/untrusted_code')
  14.  
  15. # UPDATE: JRuby have some issues that allow users to run untrusted code that can access/ modify file system,
  16. # I'm planning to submit it issues to jruby team, so don't feel safe when using security manager to run ruby
  17. # code :(
Add Comment
Please, Sign In to add comment