组合视图 统一视图 树状图
toggle
donino pienni
System.getProperties() with SecurityManager enabled
2014年5月8日 上午12:34
答复

donino pienni

等级: Youngling

帖子: 0

加入日期: 2011年7月2日

最近的帖子

Hi everyone,

We use a third-party library in a portlet application which gets a snapshot of all system properties:

1Properties systemProperties = System.getProperties();
2....
3properties.putAll(systemProperties);  //properties is a static variable in this library

in liferay-plugin-package.properties i have set:

1security-manager-properties-read=*


When security-manager-enabled is set to "generate", it does not add anything more in pacl-policy. The generator does not seem to see it, and everything works finely. But when i turn security-manager-enabled to true, i get an exception such:

1  Caused by: java.security.AccessControlException: Access denied ("java.util.PropertyPermission" "*" "read,write")
2    at com.liferay.portal.security.pacl.PortalPolicy.implies(PortalPolicy.java:195)
3    at java.security.ProtectionDomain.implies(ProtectionDomain.java:272)
4    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:350)
5    at java.security.AccessController.checkPermission(AccessController.java:559)
6    at com.liferay.portal.security.pacl.PortalSecurityManagerImpl.checkPermission(PortalSecurityManagerImpl.java:299)
7    at java.lang.SecurityManager.checkPropertiesAccess(SecurityManager.java:1269)
8    at java.lang.System.getProperties(System.java:623)



Is this "System.getProperties" strictly forbidden, even if we give a read access on all properties?
Is there a possible workaround, or should we have to change the source code of this library?

Thanks!
Dmitry Kovalev
RE: System.getProperties() with SecurityManager enabled
2017年3月27日 上午12:28
答复

Dmitry Kovalev

等级: Youngling

帖子: 1

加入日期: 2015年4月1日

最近的帖子

Hi Donino!

Have you solve this problem? What is the result of your research?
I have the same situation....
https://web.liferay.com/community/forums/-/message_boards/message/87604806

Forums

To access the Developer Forum, please login to your Liferay.com account if you are already a registered developer or register to become a developer.