AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

simple question - policy file

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java
View previous topic :: View next topic  
Author Message
Abbas
Guest





PostPosted: Tue Sep 02, 2003 5:48 pm    Post subject: simple question - policy file Reply with quote



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





PostPosted: Tue Sep 02, 2003 8:27 pm    Post subject: Re: simple question - policy file Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Security and Java All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.