Solved

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

Posted on 1998-02-19
5
155 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
type mismatch (Object[] to double[] 4 41
servlet web applications   metadata-complete="true" or false 3 200
mysql jsp example issue 32 74
glassfish admin console 1 22
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

733 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