Visualização combinada Visão plana Exibição em árvore
toggle
donino pienni
System.getProperties() with SecurityManager enabled
8 de Maio de 2014 00:34
Resposta

donino pienni

Ranking: Youngling

Mensagens: 0

Data de entrada: 2 de Julho de 2011

Mensagens recentes

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
27 de Março de 2017 00:28
Resposta

Dmitry Kovalev

Ranking: Youngling

Mensagens: 1

Data de entrada: 1 de Abril de 2015

Mensagens recentes

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.