Skip to content
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

Access denied when using a security manager #390

Open
twasink opened this issue Feb 26, 2022 · 1 comment
Open

Access denied when using a security manager #390

twasink opened this issue Feb 26, 2022 · 1 comment

Comments

@twasink
Copy link

twasink commented Feb 26, 2022

When using 0.10.x, and running with a security manager, trying to use new Reflections(scanPrefix) results in an AccessControlException, like this one:

Feb. 26, 2022 10:48:08 PM org.reflections.vfs.Vfs fromURL
WARNING: could not create Dir using jarUrl from url jar:file:<path to JAR file>.jar!/. skipping.
java.security.AccessControlException: access denied ("java.io.FilePermission" "file:/<path to JAR file>.jar!" "read")
	at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
	at java.base/java.security.AccessController.checkPermission(AccessController.java:897)
...

This happens even with a policy file that grants all permissions.

It works fine with 0.9.11

Arguments to the JVM: -Djava.security.manager=default -Djava.security.policy=all_perms.policy

Example policy file: all_perms.policy.txt

@twasink
Copy link
Author

twasink commented Feb 26, 2022

I can reproduce the problem in a unit test, but that test is a bit much to drop in here. I'll try and create a standalone project that reproduces the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant