Solved

Can't get out of sandbox with MSIE 4.0!!

Posted on 1998-02-19
5
151 Views
Last Modified: 2010-04-16
I am trying to write an applet that can read and write files on the user's local machine.  I cannot use any server-side tricks for this.  With MSIE 4.0, you are supposed to be able to sign your applet and request certain capabilities (which I am).  It appears possible (typically lousy Microsoft documentation) that you need to call the PolicyEngine.assertPermission(); function in the method if your applet when it's about to do the thing which you requested permission for (though I have tried both with & without this function).  I cannot find any way to convince MSIE to let me operate "outside the sandbox".
On the microsoft.public.java.security newsgroup, this is a common problem - either it simply doesn't work, or there is some little detail Microsoft forgot to mention!
0
Comment
Question by:ccooper
  • 3
  • 2
5 Comments
 
LVL 32

Expert Comment

by:jhance
Comment Utility
The settings are buried down deep in the IE4.0 menus:

View>Internet Options>Security>Custom>Settings>Java Permissions>Custom>Java Custom Settings>Edit Permissions>Signed Content>Access to All Files>Enable


Whew!
0
 

Author Comment

by:ccooper
Comment Utility
I don't think that's really the answer.  If I understand that dialog correctly, what you suggest would in effect tell MSIE that _all_ signed applets (from whichever 'zone' I'm editing) will have access to all files, whether they ask for it or not.  That's not what I wanted.  Plus, when this applet is "set loose" on the web, I really can't expect everyone to be dinking around with their security options.

As I played with it more, I think it is in fact an MSIE bug.  Turns out, if you specify the "useslibrary" param in the applet tag (so the applet is downloaded only once unless a new version becomes available), the applet forgets which privileges you asked for.  If you just use the "cabbase" tag, so it re-downloads each time, the privilege stuff seems to work (that is, the applet gets the privileges it requested, without changing the security options for MSIE itself).  I am still checking the details, but that seems to be true ...

Chris

0
 
LVL 32

Expert Comment

by:jhance
Comment Utility
Before ANY applet will get the FILE read/write permission the user of IE must enable it.  There are 3 options for this permission: ENABLE, DISABLE, PROMPT.  If it's set to DISABLE (which is the installation default) no JAVA applet will get access to any local file.  You're correct, however, in your assertion that if you open it up to one signed applet you open it up to all.  That's the current state of Java sandbox "rules".
0
 

Author Comment

by:ccooper
Comment Utility
Hum ... I have never entered that dialog before, so I assume the values are still at their defaults - and yet even when I load my applet from a remote web page (so I'm in the 'Internet zone'), I can get file read/write privileges simply by signing the CAB file and then doing the assertPermission.
Even if changing this value was required, it seems that setting it to 'Prompt' instead of 'Enable' would be safer!

0
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
Comment Utility
Well, prompt vs. enable is up to you, but disable is still the default for the "Internet Zone" in IE 4.0
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now