Torus
asked on
applets grants permission in Netscape
I wrote a applet and want to grant permission to read property.
I add the following code.
netscape.security.Privileg eManager.e nablePrivi lege("Univ ersalPrope rty read);
Then I use System.getProperty("user.h ome").
When I run the applet, I see a dialog box asking me to grant or deny permission.( Because I haven't signed my applet, it said my is not digitally signed). Then I pressed grant button.
But when running the getProperty statement. The following error
occurs
# Applet exception: security.checkpropsaccess. key
netscape.security.AppletSe curityExce ption: security.checkpropsaccess. key
at java.lang.Throwable.<init> (Compiled Code)
at java.lang.Exception.<init> (Compiled Code)
at java.lang.RuntimeException .<init>(Co mpiled Code)
at java.lang.SecurityExceptio n.<init>(C ompiled Code)
at netscape.security.AppletSe curityExce ption.<ini t>(Compile d Code)
at netscape.security.AppletSe curityExce ption.<ini t>(Compile d Code)
at netscape.security.AppletSe curity.che ckProperty Access(Com piled Code)
at java.lang.SecurityManager. checkPrope rtyAccess( Compiled Code)
* at java.lang.System.getProper ty(Compile d Code)
at Capture.run(Compiled Code)
at java.lang.Thread.run(Compi led Code)
java.io.IOException: CreateProcess: vcafe -netscape error=2
at java.lang.Win32Process.<in it>(Compil ed Code)
at java.lang.Runtime.exec(Com piled Code)
* at java.lang.Runtime.exec(Com piled Code)
at netscape.debug.Debugger.la unchDebugg er(Compile d Code)
at netscape.debug.Debugger.un caughtExce ption(Comp iled Code)
at netscape.applet.AppletThre adGroup.un caughtExce ption(Comp iled Code)
What's the problem?
ALso, netscape's JVM has java.security package?
I add the following code.
netscape.security.Privileg
Then I use System.getProperty("user.h
When I run the applet, I see a dialog box asking me to grant or deny permission.( Because I haven't signed my applet, it said my is not digitally signed). Then I pressed grant button.
But when running the getProperty statement. The following error
occurs
# Applet exception: security.checkpropsaccess.
netscape.security.AppletSe
at java.lang.Throwable.<init>
at java.lang.Exception.<init>
at java.lang.RuntimeException
at java.lang.SecurityExceptio
at netscape.security.AppletSe
at netscape.security.AppletSe
at netscape.security.AppletSe
at java.lang.SecurityManager.
* at java.lang.System.getProper
at Capture.run(Compiled Code)
at java.lang.Thread.run(Compi
java.io.IOException: CreateProcess: vcafe -netscape error=2
at java.lang.Win32Process.<in
at java.lang.Runtime.exec(Com
* at java.lang.Runtime.exec(Com
at netscape.debug.Debugger.la
at netscape.debug.Debugger.un
at netscape.applet.AppletThre
What's the problem?
ALso, netscape's JVM has java.security package?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
yup. I use thread. The you mean that I need to put the enablePrivileage code in the thread?
ASKER
I tried to put enablePrivilege("Universal FileAccess ") to the thread also. But I got error when reading file
netscape.security.AppletSe curityExce ption: security.checkread: Codebase 'MyDir' does not include 'UserhomeDir/user.wav'
MyDir is the directory storing the class file. I tested it in local machine only without using web server.
It seems I can't read the UserhomeDir file.
netscape.security.AppletSe
MyDir is the directory storing the class file. I tested it in local machine only without using web server.
It seems I can't read the UserhomeDir file.
> netscape.security.AppletSe curityExce ption: security.checkread: ..
if you want to read files, you have to enable file reading too
if you want to read files, you have to enable file reading too
ASKER
but UnversialFileAccess includes read, write and delete operator, right?
can't check at the moment ...
I found these three lines of code in some old project
netscape.security.Privileg eManager.e nablePrivi lege("Univ ersalFileR ead");
netscape.security.Privileg eManager.e nablePrivi lege("Univ ersalFileW rite");
netscape.security.Privileg eManager.e nablePrivi lege("Univ ersalConne ct");
I found these three lines of code in some old project
netscape.security.Privileg
netscape.security.Privileg
netscape.security.Privileg
ASKER
ok, I know what the problem is.
Thanks
Thanks
ASKER