You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ScriptEngine engine = new JRubyEngineFactory().getScriptEngine();
fails with an AccessControlException in JRuby 9.0.0.0 on Windows:
java.security.AccessControlException: access denied ("java.io.FilePermission" "uri:classloader:\META-INF\jruby.home" "read")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457)
at java.security.AccessController.checkPermission(AccessController.java:884)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.SecurityManager.checkRead(SecurityManager.java:888)
at java.io.File.exists(File.java:814)
at org.jruby.RubyInstanceConfig.setupEnvironment(RubyInstanceConfig.java:674)
at org.jruby.RubyInstanceConfig.<init>(RubyInstanceConfig.java:123)
at org.jruby.embed.internal.AbstractLocalContextProvider.getGlobalRuntimeConfigOrNew(AbstractLocalContextProvider.java:95)
at org.jruby.embed.internal.SingletonLocalContextProvider.initLocalContext(SingletonLocalContextProvider.java:56)
at org.jruby.embed.internal.SingletonLocalContextProvider.getProvider(SingletonLocalContextProvider.java:49)
at org.jruby.embed.ScriptingContainer.getProviderInstance(ScriptingContainer.java:267)
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:245)
at org.jruby.embed.jsr223.JRubyEngineFactory.getScriptEngine(JRubyEngineFactory.java:170)
RubyInstanceConfig#setupEnvironment is calling File#exists but fails to catch the potential exception from this method:
But in this situation, jrubyHome isn't even a file path, it's a URI.
I could add a quick check here that the path doesn't start with "uri:", but it isn't clear what the correct behaviour should be in this situation. Should the code be properly checking that the URI exists?
The text was updated successfully, but these errors were encountered:
OK, that PATTERN matching could be shared at package level ... was mostly interested in avoiding the (anticipated) regression the commit(s) has introduced but if you're to change that to avoid the new File anyways its all yours ... please fix it on 1.7 as well, thanks
Just trying to create a script engine:
fails with an AccessControlException in JRuby 9.0.0.0 on Windows:
RubyInstanceConfig#setupEnvironment
is callingFile#exists
but fails to catch the potential exception from this method:But in this situation,
jrubyHome
isn't even a file path, it's a URI.I could add a quick check here that the path doesn't start with "uri:", but it isn't clear what the correct behaviour should be in this situation. Should the code be properly checking that the URI exists?
The text was updated successfully, but these errors were encountered: