Security permissions for JRuby 1.2?


#1

I was getting a really cryptic error running JRuby 1.2 under the same
security permissions as 1.1.4.

Here is the list of granted permissions:

grant {
permission java.util.PropertyPermission “", “read”;
permission java.lang.RuntimePermission "getenv.
”;
permission java.io.FilePermission “<>”,
“read,write,delete,execute”;
permission java.net.SocketPermission “", “connect,accept,resolve”;
permission java.net.SocketPermission "
:1024-”, “listen”;
permission java.lang.RuntimePermission “createClassLoader”;
permission java.lang.reflect.ReflectPermission
“suppressAccessChecks”;
permission javax.management.MBeanServerPermission
“createMBeanServer”;
permission javax.management.MBeanPermission
“org.jruby.#-[org.jruby:name=,service=*,type=Runtime]”,
“unregisterMBean”;
permission java.lang.RuntimePermission “shutdownHooks”;
permission javax.management.MBeanServerPermission “findMBeanServer”;
permission java.lang.RuntimePermission “getProtectionDomain”;
}

And here is what happens when I try to include a gem:

file:/D:/App/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/defaults/jruby.rb:86:in
spec_directories_from_classpath': undefined methodgetResources’ for
#Java::OrgJrubyUtil::JRubyClassLoader:0x9a44d6 (NoMethodError)
from
file:/D:/App/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/defaults/jruby.rb:81:in
installed_spec_directories' from file:/D:/App/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:56:infrom_installed_gems’
from
file:/D:/App/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:736:in
source_index' from file:/D:/App/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:140:inactivate’
from
file:/D:/App/lib/jruby-complete.jar!/META-INF/jruby.home/lib/ruby/site_ruby/1.8/rubygems.rb:49:in
`gem’
from C:\Testing\run-tests.rb:7

Basically I need to know what permission I can add here to make it work
again. The number of possible permissions I might need to grant is a
bit
large for trial and error. I specifically don’t want to use
AllPermission
because that includes the ability to do a few things which scripts
really
shouldn’t be able to do, such as shutting down the entire JVM. :slight_smile:

Daniel


View this message in context:
http://www.nabble.com/Security-permissions-for-JRuby-1.2--tp22942756p22942756.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

#2

Daniel Noll wrote:

Basically I need to know what permission I can add here to make it work
again.

To answer my own question, we now need this:

permission java.lang.RuntimePermission "accessClassInPackage.*";

I’m not sure if * is a great idea, but I thought it was already the
default.
For whatever reason it’s now required, still not clear as to why.

Daniel


View this message in context:
http://www.nabble.com/Security-permissions-for-JRuby-1.2--tp22942756p23091356.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email