-
Bug
-
Resolution: Won't Fix
-
P3
-
7
-
generic
-
windows
REGRESSION
----------
Licensee suspects issue since JDK 7 b140.
SYNOPSIS
--------
Regression: Control Panel system properties not passed to old plugin
OPERATING SYSTEM
----------------
Windows
FULL JDK VERSION
----------------
JDK 7 - regression occurred recently (possbily b140)
DESCRIPTION from LICENSEE
-------------------------
The issue basically is that arguments passed through the Java Runtime parameters in the Java Control Panel are not getting passed to the old plugin properly.
The root cause is in the function CPluginRegistry::LoadUserProperties() in /src/plugin/win32/common/PluginRegistry.cpp. This function reads the deployment.properites from %APPDATA%\IBM\Java\Deployment\Deployment.properties. It then compares the deployment.javaws.jre.0.product=1.7.0 against PLUGIN_PRODUCT_VERSION.
char* lpszJreProp = strtok(NULL, ".");
if (lstrcmpi(lpszJreProp, "product") == 0) {
--> if (lstrcmpi(szPropValue, PLUGIN_PRODUCT_VERSION) == 0) { <--
foundJREIndex = index;
break;
}
...
The Plugin / Deployment version was changed to "10.0.0.0" under CR 7036490, but the product version written to the properties file is "1.7.0". So, the comparison fails and the function returns E_FAIL. This can be fixed by using JAVA_VERSION for the comparison instead.
Since this affects the basic functionality of passing the java runtime parameters itself, we consider the issue to be high severity.
REPRODUCTION INSTRUCTIONS
-------------------------
1. Install JDK
2. Ensure that next generation plugin is disabled
3. Add a system property to the command line via Control Panel in
Control Panel -> Java -> Java -> View... -> Runtime Parameters,
pointing to the customer security policy file (e.g.
-Djava.security.policy=<location_of_policy.file>)
3. Compile and launch the test applet provided below
Expected output:
Successfully wrote to the file named : temp.file
Passed
Observed output:
Failed: security exception
TESTCASE
--------
WriteFile.html
--------
<html>
<applet code="WriteFile.class" width=325 height=300>
</html>
--------
policy.file
--------
grant {
permission java.security.AllPermission;
};
--------
WriteFile.java
--------
public class WriteFile extends Applet {
String filename;
public void init() {
filename = "temp.file";
}
public void paint(Graphics g) {
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(filename));
writer.write("Testcase browser-security: Successfully wrote to temp.file! \n");
writer.close();
g.drawString("Successfully wrote to the file named : " + filename, 10, 10);
g.drawString("Passed", 10, 30);
}
catch (SecurityException e) {
g.drawString("Failed: security exception", 10, 10);
} catch (IOException e) {
g.drawString("Failed: I/O exception", 10, 10);
}
}
}
----------
Licensee suspects issue since JDK 7 b140.
SYNOPSIS
--------
Regression: Control Panel system properties not passed to old plugin
OPERATING SYSTEM
----------------
Windows
FULL JDK VERSION
----------------
JDK 7 - regression occurred recently (possbily b140)
DESCRIPTION from LICENSEE
-------------------------
The issue basically is that arguments passed through the Java Runtime parameters in the Java Control Panel are not getting passed to the old plugin properly.
The root cause is in the function CPluginRegistry::LoadUserProperties() in /src/plugin/win32/common/PluginRegistry.cpp. This function reads the deployment.properites from %APPDATA%\IBM\Java\Deployment\Deployment.properties. It then compares the deployment.javaws.jre.0.product=1.7.0 against PLUGIN_PRODUCT_VERSION.
char* lpszJreProp = strtok(NULL, ".");
if (lstrcmpi(lpszJreProp, "product") == 0) {
--> if (lstrcmpi(szPropValue, PLUGIN_PRODUCT_VERSION) == 0) { <--
foundJREIndex = index;
break;
}
...
The Plugin / Deployment version was changed to "10.0.0.0" under CR 7036490, but the product version written to the properties file is "1.7.0". So, the comparison fails and the function returns E_FAIL. This can be fixed by using JAVA_VERSION for the comparison instead.
Since this affects the basic functionality of passing the java runtime parameters itself, we consider the issue to be high severity.
REPRODUCTION INSTRUCTIONS
-------------------------
1. Install JDK
2. Ensure that next generation plugin is disabled
3. Add a system property to the command line via Control Panel in
Control Panel -> Java -> Java -> View... -> Runtime Parameters,
pointing to the customer security policy file (e.g.
-Djava.security.policy=<location_of_policy.file>)
3. Compile and launch the test applet provided below
Expected output:
Successfully wrote to the file named : temp.file
Passed
Observed output:
Failed: security exception
TESTCASE
--------
WriteFile.html
--------
<html>
<applet code="WriteFile.class" width=325 height=300>
</html>
--------
policy.file
--------
grant {
permission java.security.AllPermission;
};
--------
WriteFile.java
--------
public class WriteFile extends Applet {
String filename;
public void init() {
filename = "temp.file";
}
public void paint(Graphics g) {
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(filename));
writer.write("Testcase browser-security: Successfully wrote to temp.file! \n");
writer.close();
g.drawString("Successfully wrote to the file named : " + filename, 10, 10);
g.drawString("Passed", 10, 30);
}
catch (SecurityException e) {
g.drawString("Failed: security exception", 10, 10);
} catch (IOException e) {
g.drawString("Failed: I/O exception", 10, 10);
}
}
}