-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AccessControlException with wrong path when calling File.realpath under SecurityManager and classpath containing spaces #4633
Comments
The URL encoding may be correct. Note from the stack trace that this constructor passes through URLResource on the way to the jar. Now whether that's the correct logic to use at that level, I'm not sure, but we're just asking for a resource out of a jar, which usually is handled as a URL at some point. Is there really nothing at the path it reports, or is there some symlinking involved? What happens if you give it permission for the "bogus" path? |
If I add the permit line for the wrong path, it finishes. But the file it was wasn't in that jar anyway, so it should have worked either way, IMO. If I log the calls to the
|
Ok so one theory would be that our JarIndex class should just fail to index jars when there's a security violation. Then it would move on to other jars looking for the requested file. I'll push a branch, if you can test it out. |
@trejkaz Have a look at #4640. |
Verifying that everything is OK on 9.1.12.0. I know I should have checked earlier, but as usual, other things always seem to jump to the top of the stack... |
Environment
JRuby 9.1.10.0
Java 1.8.0 u92
Security manager enabled
IDEA installed at "/Applications/IntelliJ IDEA CE.app"
Other relevant info you may wish to add:
Expected Behavior
This test code:
When running with no security manager, passes. So I'd expect it to pass under the security manager too.
Actual Behavior
When running under the security manager, it appears to be accessing a bogus path:
The actual path has been granted in the policy, like so:
So I think there are two problems here.
Admittedly, this one is a pretty obscure issue. :/
The text was updated successfully, but these errors were encountered: