Solved

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

Posted on 1998-02-19
5
153 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
ID: 1233154
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
ID: 1233155
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
ID: 1233156
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
ID: 1233157
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
ID: 1233158
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
jar file executable 12 52
even odd program using while loop 3 41
login jsp example 24 50
ejb on wildfly 5 20
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

809 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