フォーラム

ホーム » 1. Marketplace App Development

構造的に表示 平面上に表示 ツリー上に表示
toggle
donino pienni
System.getProperties() with SecurityManager enabled
2014/05/08 0:34
答え

donino pienni

ランク: Youngling

投稿: 0

参加年月日: 2011/07/02

最近の投稿

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/03/27 0:28
答え

Dmitry Kovalev

ランク: Youngling

投稿: 1

参加年月日: 2015/04/01

最近の投稿

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.