simple question - policy file - Java
This is a discussion on simple question - policy file - Java ; Hi,
I have this simple scenario. I have a target class in
D:\java\Target.class. I have a caller class in D:\java\Caller.class. I
also have another caller class in D:\java\BadCaller.class. I want to
give access only to Caller.class to access Target.class. For ...
-
simple question - policy file
Hi,
I have this simple scenario. I have a target class in
D:\java\Target.class. I have a caller class in D:\java\Caller.class. I
also have another caller class in D:\java\BadCaller.class. I want to
give access only to Caller.class to access Target.class. For this I
created an entry in the policy file like this:
grant codeBase "file:d:/java/Caller.class" {
permission java.lang.RuntimePermission "d:\java\Target", "read";
};
When I run the caller classes, I provide -Djava.security.manager
variable. However, both Caller and BadCaller can access Target class.
Am I missing anything here? Appreciate any help.
Thanks.
-
Re: simple question - policy file
On 2 Sep 2003 10:48:41 -0700, abbasrazam@yahoo.com (Abbas) wrote or
quoted :
>I have this simple scenario. I have a target class in
>D:\java\Target.class. I have a caller class in D:\java\Caller.class. I
>also have another caller class in D:\java\BadCaller.class. I want to
>give access only to Caller.class to access Target.class. For this I
>created an entry in the policy file like this:
Are you doing this in an Applet or application? You can use the
policy file only to give permission, not to block access to what would
normally be ok, not unless you put your own security manager check in
the potentially forbidden code.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Similar Threads
-
By Application Development in forum Idl-pvwave
Replies: 3
Last Post: 10-10-2007, 10:26 AM
-
By Application Development in forum Fortran
Replies: 5
Last Post: 07-30-2007, 05:07 AM
-
By Application Development in forum DOTNET
Replies: 1
Last Post: 05-29-2007, 11:29 AM
-
By Application Development in forum DOTNET
Replies: 4
Last Post: 08-23-2006, 12:02 AM
-
By Application Development in forum Java
Replies: 0
Last Post: 02-22-2004, 10:16 PM