JDK-6967841 : Plugin2's IPCFactory.java incorrectly parses incoming arguments
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u20
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2010-07-09
  • Updated: 2010-10-11
  • Resolved: 2010-10-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u23 b02Fixed 7Fixed
Description
In the IPCFactory.java there is an assumption that the IPC arguments cannot have multiple equals characters. On Mac OS X , java.io.tmpdir points to a path that may have an equals character in it. In this case the IPC mechanism is completly broken and Plugin2 dies.

For example the argument to the child can be :

write_pipe_name=/var/folders/5s/bgzw1=tc658d0vqrjrd1s593++++fn/T/.com.sun.deploy.net.socket.-1.4567144119737929337.AF_UNIX


The fix for this problem is as below :


svn diff --depth empty -x -u -x -w 'src/plugin/share/classes/sun/plugin2/ipc/IPCFactory.java'
Index: src/plugin/share/classes/sun/plugin2/ipc/IPCFactory.java
===================================================================
@@ -140,8 +140,14 @@
        Map/*<String,String>*/ map = new HashMap/*<String,String>*/();
        String[] strs = inputString.split(",");
        for (int i = 0; i < strs.length; i++) {
-            String[] kv = strs[i].split("=");
-           map.put(kv[0], kv[1]);
+                String str = strs[i];
+                int firstEquals = str.indexOf("=");
+                map.put(str.substring(0, firstEquals), str.substring(firstEquals+1, str.length()));
        }
        return map;
}

Comments
EVALUATION Implementin changes based on Apple's suggestion, verified with Apple after send bundle to them.
14-09-2010

WORK AROUND None exists. On Mac OS X the code have modified as shown in the bug description.
09-07-2010