Forum: JRuby Security permissions for JRuby 1.2?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E4788fb2085bd6773be972ae737099e3?d=identicon&s=25 Daniel Noll (Guest)
on 2009-04-08 06:23
(Received via mailing list)
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 "<<ALL FILES>>",
"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 method `getResources' 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:in
`from_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:in
`activate'
        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. :-)

Daniel


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


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
E4788fb2085bd6773be972ae737099e3?d=identicon&s=25 Daniel Noll (Guest)
on 2009-04-17 07:34
(Received via mailing list)
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-JRu...
Sent from the JRuby - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.