Vista Combinata Vista Piatta Vista ad Albero
toggle
donino pienni
System.getProperties() with SecurityManager enabled
8 maggio 2014 0.34
Risposta

donino pienni

Punteggio: Youngling

Messaggi: 0

Data di Iscrizione: 2 luglio 2011

Messaggi recenti

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 marzo 2017 0.28
Risposta

Dmitry Kovalev

Punteggio: Youngling

Messaggi: 1

Data di Iscrizione: 1 aprile 2015

Messaggi recenti

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.