Security permission problem

I have a special security policy file, which grants permission to a certain code tree, like:

grant codeBase "file:${test.home}
classes
-" {
permission java.security.AllPermission;
};

grant codeBase "file:${test.home}
src-" {
permission java.security.AllPermission;
};

And a simple test program which runs fine from the command line and fails in idea. Any particular reason for it ?

Test programm:

public class PermissionTest
{


public static void main(String[] args) {
System.setProperty("test.home", "z:
ndev");
System.setProperty("java.security.policy", "z:
ndev" + File.separator + "lib" + File.separator + "security" +
File.separator + "server_test.policy");
System.out.println("test.home=" + System.getProperty("test.home"));
System.out.println("java.security.policy=" + System.getProperty("java.security.policy"));
System.setSecurityManager(new SecurityManager());
try {
AccessController.checkPermission(new java.lang.RuntimePermission("MyTestPermission"));
} catch(AccessControlException ace) {
ace.printStackTrace();
}
}
}

1 comment

Please, submit a bug report in http://www.intellij.net/tracker/idea/browse

--
Stanislav Davydov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

"Polina" <p_alber@yahoo.com> wrote in message news:19663641.1071096891153.JavaMail.javamailuser@localhost...

I have a special security policy file, which grants permission to a certain code tree, like:

>

grant codeBase "file:${test.home}
classes
-" {
permission java.security.AllPermission;
};

>

grant codeBase "file:${test.home}
src-" {
permission java.security.AllPermission;
};

>

And a simple test program which runs fine from the command line and fails in idea. Any particular reason for it ?

>

Test programm:

>

public class PermissionTest
{

>
>

public static void main(String[] args) {
System.setProperty("test.home", "z:
ndev");
System.setProperty("java.security.policy", "z:
ndev" + File.separator + "lib" + File.separator + "security" +
File.separator + "server_test.policy");
System.out.println("test.home=" + System.getProperty("test.home"));
System.out.println("java.security.policy=" + System.getProperty("java.security.policy"));
System.setSecurityManager(new SecurityManager());
try {
AccessController.checkPermission(new java.lang.RuntimePermission("MyTestPermission"));
} catch(AccessControlException ace) {
ace.printStackTrace();
}
}
}

>


0

Please sign in to leave a comment.