view test/java/rmi/server/RMISocketFactory/useSocketFactory/activatable/security.policy @ 16271:ddd192238fcb

8171076: improve rmi tests by replacing TestLibrary.createRegistryOnUnusedPort, getUnusedRandomPort Reviewed-by: rriggs
author mli
date Tue, 13 Dec 2016 18:47:23 -0800
parents 7f8294841146
children
line wrap: on
line source
/*
 * security policy used by the test process
 */

grant {
  // property specifically accessed by this test
  permission java.util.PropertyPermission "user.name", "read";

  // standard test activation permissions
  permission java.io.FilePermission "..${/}..${/}test.props", "read";

  // test needs to cleanup rmid's log.
  permission java.io.FilePermission ".${/}log", "read,write,delete";
  permission java.io.FilePermission ".${/}log${/}-", "read,write,delete";

  // test needs to use java to exec an rmid
  permission java.io.FilePermission "${java.home}${/}bin${/}java", "execute";

  // test uses these permissions to propagate security values to rmid
  permission java.util.PropertyPermission "java.security.policy", "read";
  permission java.util.PropertyPermission "java.security.manager", "read";

  // used by TestLibrary to get the RMI Registry port
  permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.registry";
  permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.server";
  permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport";
  permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.proxy";
  permission java.lang.RuntimePermission "accessClassInPackage.sun.rmi.transport.tcp";

  // used by TestLibrary to determine test environment 
  permission java.util.PropertyPermission "test.*", "read";
  permission java.util.PropertyPermission "user.dir", "read";
  permission java.util.PropertyPermission "java.home", "read";

  permission java.util.PropertyPermission "rmi.registry.port", "read";
  permission java.util.PropertyPermission "java.rmi.activation.port", "write";

  // required for test to create an ActivationGroup
  permission java.lang.RuntimePermission "setFactory";

  // test needs to export rmid and communicate with objects on arbitrary ports
  permission java.net.SocketPermission "*:1024-", "connect,accept,listen";
};