-
Notifications
You must be signed in to change notification settings - Fork 211
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
Gracefully degradation if loading system properties throws an exception (e.g. Java Security Manager) #202
Comments
…ng system properties
Crazy what these architecture departments come up with... fixed it. |
Thanks for fixing this so quickly. Do you have a release we can use to test with? I see that 3.1.9 is still the latest release. What do you recommend? |
No problem; I will soon prepare a new release. Stay tuned... |
Release 3.1.10 is out the door. |
Thanks, I'm starting to validate the change. Just waiting on pipelines... |
Oh man, you gotta be kidding me. Apparently there's other usages of System.getProperty that are throwing errors now. I didn't even know
Meanwhile, our IT department has agreed to add wildcard exceptions for Janino, so I think we'll be okay soon even if there aren't any other changes. I can't speak for anyone else who's using the Security Manager. As far as I'm concerned, I don't need this issue to be open any longer. I'll leave it up to you what you want to do with it. Thanks again! |
I'd say that nobody else has ever configured the SecurityManager to catch |
I'm trying to run Janino in an environment where the Java Security Manager restricts reading system properties unless specifically permitted. (Yes, my organization's IT department relies on Java's Security Manager, despite the fact Oracle has deprecated it and plans to remove it. I'm not in charge of that decision.)
When the Security Manager blocks reading a property, it throws a security exception where the read was attempted. I can petition my IT department to add new system properties, but the process is bureaucratic and slow.
Between 3.1.6 and 3.1.9, Janino started reading several System Properties while loading the classes AbstractCompiler and SimpleCompiler. I have successfully petitioned the security folks to permit loading system properties from a wildcard (
org.janino.*
), but the fallback mechanism in SystemProperties.java -- whereby it checks for a full classpath, but falls back to the class' simple name if another value is not found -- makes it very difficult to write a policy exception because every time a new class in Janino reads a system property, we'd have to account for it.I propose wrapping these reads in a simple try/catch block.
I can provide a merge request.
The text was updated successfully, but these errors were encountered: