Converting JavaScript/Java code that runs on Netscape 4.8 to Mozilla 1.4.1.
on AIX 5.1.
Exception
<<java.security.PrivilegedActionException<<java.lang.IllegalAccessException:
java/lang/UNIXProcess>> >> is thrown.
I narrowed the code down to code that uses the process created from a
Runtime.exec( ) call. . Note that in the case the exception is thrown,
the value of "wait" variable is TRUE. If I change the "wait" to FALSE, the
exception is not thrown.
While searching for clues on various web sites, I found an old reference to
a similar problem that happened on Windows when the java.lang.Win32Process
class was not completely implemented in the Java VM. Could something
similar be happening at the java.lang.UNIXProcess layer in the Java VM ??
The help I need is to modify the code so it works without throwing the above
exception. The JavaScript runs an application that is already installed on
the client's local system. The application unpacks a file and reads a file
in HTML format and then a reload( ) function is called on the Window object
to refresh the browser's content from a file that is written to a directory
on the local system.
Here is the function that was originally written for Netscape 4.x and
recently tested with Netscape 4.8. The enablePrivilege( ) has been modified
to include the "target" privileges of "UniversalBrowserRead",
"UniversalFileRead", and "UniversalFileWrite". The only one of those
targets that appears to be required is "UniversalBrowserRead".
The value of the "cmd" variable is "cmd = ecsrpkg.exe u". That variable is
passed as a parameter to NS_Exec( ). The function that "ecsrpkg.exe u" does
works because I am asked to select a file to unzip and the unzip operation
completes correctly when I look in the directory structure for the files
that are unzipped. The PATH environment variable has been modified to
include the path to the program, ecsrpkg.exe.
function NS_Exec (cmd, wait) // Netscape
{
var e = '';
try {
var result = ''; // return code from command
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead
UniversalFileRead UniversalFileWrite"); //retest with Netscape 4.8 as
well as Mozilla
runtime = java.lang.Runtime.getRuntime();
process = runtime.exec (cmd);
if (wait)
{
inputStreamReader =
java.io.InputStreamReader(process.getInputStream());
bufferedReader = java.io.BufferedReader (inputStreamReader);
result = bufferedReader.readLine();
}
}
catch (e){
if (e instanceof Error)
alert(e.name + ": " + e.message);
else
alert(e);
}
return result;
}
_______________________________________________
Mozilla-security mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-security