Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.0M12
-
None
-
All platforms
-
Patch Available
Description
Please consider the following testmethod:
public void test_policyFileEntry_contains_Quotes1() throws Exception
{ System.setProperty("java.security.policy", "resources/policyTest2.txt"); AccessController.checkPermission(new RuntimePermission("setSecurityManager")); }Above test passes with RI. HDK throws AccessControlException. HDK not able to parse the Policy file if the particular entries permission_class_name enclosed with quotes. But as per javadoc, policy file entry must be the following [1]. But RI allows the quotes for permission_class_name. Please find the sample policy file entry here [2]
[1]
permission permission_class_name ["target_name"] [, "action_list"] [, signedby "name1,...,nameN"]
[2]
policyTest.txt:
==========
grant {
permission java.util.PropertyPermission "user.dir", "read";
permission java.lang.RuntimePermission "createClassLoader";
permission java.io.FilePermission "<<ALL FILES>>", "delete";
permission java.io.FilePermission "<<ALL FILES>>", "read";
permission "java.util.PropertyPermission" "java.security.policy", "write";
permission "java.lang.RuntimePermission" "setSecurityManager";
permission "java.util.PropertyPermission" "java.security.policy", "read";
permission "java.lang.RuntimePermission" "setIO";
};