How do I grant a program, after setting RMISecurityManager for the system, the permissions to read and write all of the System properties?

Dieter Wimberger

You have to grant the permission via the policy file. This looks like:

java.util.PropertyPermission "*", "read,write"

for using
 
java.lang.System
  public static Properties 
      getProperties()
  public static void 
      setProperties(Properties props)

or:

java.util.PropertyPermission "{key}", "read"

for using
java.lang.System
  public static String 
      getProperty(String key)
  public static String 
      getProperty(String key, String def)
You can also override following methods:
checkPropertiesAccess 
checkPropertyAccess

Thus enrolling your own "access policy".

Be sure to check the /guide/security/permissions.html from the Java 2 JDK documentation you are using.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact