config icon indicating copy to clipboard operation
config copied to clipboard

ConfigImpl needs write permissions for standard java util

Open mblag opened this issue 8 years ago • 2 comments

Why does the typesafe conf need write permissions for the "standard" java propertypermission that should be world readable?

Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "*" "read,write") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.security.AccessController.checkPermission(AccessController.java:884) at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1262) at java.lang.System.getProperties(System.java:630) at com.typesafe.config.impl.ConfigImpl.getSystemProperties(ConfigImpl.java:301) at com.typesafe.config.impl.ConfigImpl.loadSystemProperties(ConfigImpl.java:310) at com.typesafe.config.impl.ConfigImpl.access$000(ConfigImpl.java:34) at com.typesafe.config.impl.ConfigImpl$SystemPropertiesHolder.(ConfigImpl.java:316)

mblag avatar May 10 '18 19:05 mblag

It looks like we're calling System.getProperties and that checks for read-write permission. Maybe because the returned Properties object is mutable. I can't think of any way to avoid this, we need all the system properties, so System.getProperty won't work. I don't see a Java API to get a read-only view.

havocp avatar May 10 '18 19:05 havocp

Thank you for the quick response.

mblag avatar May 10 '18 20:05 mblag