Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / June 2004

Tip: Looking for answers? Try searching our database.

.java.policy

Thread view: 
Qu?bec - 14 Jun 2004 23:01 GMT
Hi,

Why would this does not work.  I have tried it has an application and it
works fine.
I have an applet on my desktop (desktop=Bureau) and it does not works.

In file:${java.home}/ .java.policy

grant codeBase "file:${java.home}/Bureau" {
permission java.security.AllPermission;
permission java.util.PropertyPermission "os.name", "read";
};

Jean
............................................................................
..............
 /** Calculates the relative path from root child. */
 String getRelativePath(File root, File child) {

   String relPath = child.getName();
   child = new File(child.getParent());
   while ( !child.equals(root) ) {
     relPath = child.getName() + "/" + relPath;
     child = new File(child.getParent());
   }
   return relPath;
 }
   g.drawString(getRelativePath(new File (System.getProperty("user.home")),
new File (System.getProperty("user.dir"))), 20, 60);
.........................................
Roedy Green - 15 Jun 2004 02:01 GMT
On Mon, 14 Jun 2004 18:01:37 -0400, "Québec" <personne@ok.la> wrote or
quoted :

> permission java.util.PropertyPermission "os.name", "read";
>};
[quoted text clipped - 16 lines]
>new File (System.getProperty("user.dir"))), 20, 60);
>.........................................

You gave yourself permission to look at the property not to go
stomping over the hard disk.

You did not even have to ask permission to peek at the property, since
user.dir is not a protected property.

See http://mindprod.com/wassup.html

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

Qu?bec - 15 Jun 2004 13:06 GMT
aHa...............  Would the following do the trick?

// Do what you will
grant {
permission java.security.AllPermission;
};

> > permission java.util.PropertyPermission "os.name", "read";
> >};
[quoted text clipped - 30 lines]
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
Roedy Green - 15 Jun 2004 21:00 GMT
On Tue, 15 Jun 2004 08:06:15 -0400, "Québec" <personne@ok.la> wrote or
quoted :

>// Do what you will
>grant {
>permission java.security.AllPermission;
>};

Make sure you don't grant that to EVERY Tom Dick and Harry.

See http://mindprod.com/jgloss/policyfile.html

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.