Join GitHub today
AccessControlException with wrong path when calling File.realpath under SecurityManager and classpath containing spaces #4633
Other relevant info you may wish to add:
This test code:
When running with no security manager, passes. So I'd expect it to pass under the security manager too.
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 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