Hi, I am reading the tutorial on java security by oracle. (http://download.oracle.com/javase/tutorial/security/toolsign/rstep4.html)
I duplicate all the files and everything from the tutorial basically.
I am able to run the file with security manager using the following approach in unix:
java -Djava.security.manager -Djava.security.policy=recvPolicy -cp sCount.jar Count ../../test
But when I try to specify a new policy.url in the java.security file like this:
policy.url.1=file:${java.home}/lib/security/java.policy
policy.url.2=file:${user.home}/.java.policy
policy.url.3=file:/home/myhome/SigningTest/recvPolicy
it gives me an exception when I run:
java -Djava.security.manager -cp sCount.jar Count ../../test
The exception is this:
Exception in thread "main" java.security.AccessControlException: access denied (java.io.FilePermission ../../test read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
at java.io.FileInputStream.<init>(FileInputStream.java:100)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at Count.main(Count.java:17)
thanks for feedback