 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Abbas Guest
|
Posted: Tue Sep 02, 2003 5:48 pm Post subject: simple question - policy file |
|
|
Hi,
I have this simple scenario. I have a target class in
D:javaTarget.class. I have a caller class in D:javaCaller.class. I
also have another caller class in D:javaBadCaller.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:javaTarget", "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.
|
|
| Back to top |
|
 |
Roedy Green Guest
|
Posted: Tue Sep 02, 2003 8:27 pm Post subject: Re: simple question - policy file |
|
|
On 2 Sep 2003 10:48:41 -0700, [email]abbasrazam (AT) yahoo (DOT) com[/email] (Abbas) wrote or
quoted :
| Quote: | I have this simple scenario. I have a target class in
D:javaTarget.class. I have a caller class in D:javaCaller.class. I
also have another caller class in D:javaBadCaller.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.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|