No Grant Permissions Dialog Showing
Hey guys, I am trying to write a simple applet that executes a file on the users local filesystem. I have signed the applet by first creating a keystore and then using jarsigner to self-sign the applet. However, when the applet is executed it throws an AccessControlException when trying to execute the file (a FilePermission error on the execute)
The applet is compiled in 1.5.0_09 and run in the 1.5.0_09 JRE. I have tried running the applet from an HTML page both locally through the filesystem and remotely through my webserver on 2 separate machines.
The problem is, it just throws an exception and doesn't even ask the user to grant it permissions which I imagine is what I need to do
Here is the code:
package Jim;
import java.awt.*;
import java.applet.*;
import java.io.*;
import java.util.*;
import java.security.*;
import netscape.javascript.*;
publicclass WinampConnect2extends Applet{
private String msg;
publicvoid init()
{
GetWinampInfo();
}
publicvoid paint(Graphics g){
g.drawString("MSG: " + this.msg, 50, 60 );
}
publicvoid GetWinampInfo()
{
String msg2 = (String) AccessController.doPrivileged(new PrivilegedAction()
{
public Object run()
{
try
{
FilePermission MyPerm =new java.io.FilePermission("c:\\WinampMagic.exe","execute" );
Runtime runtime = Runtime.getRuntime();
Process process =null;
process = runtime.exec("c:\\WinampMagic.exe");
DataInputStream in =new DataInputStream(process.getInputStream());
// Read and print the output
String line =null;
return in.readLine();
}
catch (Exception e)
{
System.out.print(e);
System.out.flush();
return"error";
}
}
});
this.msg = msg2;
}
}
If anyone could offer me any advice on what I am doing wrong or how to correct this I would be very appreciative. Thanks in advance guys.
Jim.

