# HG changeset patch # User Deepak Bhole # Date 1279313615 14400 # Node ID 18fa77d40df59f0163b375de4058a5aa813daeb5 # Parent bcdcc12c519e06649035449f0d78ed7fbdd8414a Fix policy evaluation to match the proprietary JDK. diff -r bcdcc12c519e -r 18fa77d40df5 ChangeLog --- a/ChangeLog Tue Jul 13 11:46:10 2010 +0200 +++ b/ChangeLog Fri Jul 16 16:53:35 2010 -0400 @@ -1,3 +1,8 @@ +2010-07-16 Deepak Bhole + + * patches/icedtea-policy-evaluation.patch: New patch. Fixes policy + evaluation to match the proprietary JDK. + 2010-07-13 Mark Wielaard Reported by William Cohen diff -r bcdcc12c519e -r 18fa77d40df5 Makefile.am --- a/Makefile.am Tue Jul 13 11:46:10 2010 +0200 +++ b/Makefile.am Fri Jul 16 16:53:35 2010 -0400 @@ -621,6 +621,7 @@ patches/icedtea-cc-interp-jvmti.patch \ patches/icedtea-pr261.patch \ patches/icedtea-doc-headers.patch \ + patches/icedtea-policy-evaluation.patch \ patches/openjdk/bidi-tests.patch \ patches/openjdk/annotation-tests.patch \ patches/openjdk/rename-execvpe.patch \ diff -r bcdcc12c519e -r 18fa77d40df5 patches/icedtea-policy-evaluation.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-policy-evaluation.patch Fri Jul 16 16:53:35 2010 -0400 @@ -0,0 +1,35 @@ +# This patch aligns policy evaluation to be the same as the proprietary JDK. +# http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-July/009658.html +# https://bugs.openjdk.java.net/show_bug.cgi?id=100142 + +diff -up ./openjdk/jdk/src/share/classes/sun/security/provider/PolicyFile.java.sav ./jdk/src/share/classes/sun/security/provider/PolicyFile.java +--- ./openjdk.orig/jdk/src/share/classes/sun/security/provider/PolicyFile.java.sav 2010-04-20 14:49:13.000000000 -0400 ++++ ./openjdk/jdk/src/share/classes/sun/security/provider/PolicyFile.java 2010-04-20 14:50:26.000000000 -0400 +@@ -1799,6 +1799,27 @@ public class PolicyFile extends java.sec + + CodeSource canonCs = cs; + URL u = cs.getLocation(); ++ ++ // If this is a jar protocol url, collapse it to a ++ // file protocol to process it as per the javadocs ++ if (u != null && u.getProtocol().equals("jar")) { ++ try { ++ String fileURL = ""; ++ ++ // remove the initial jar: ++ fileURL = u.getPath(); ++ ++ // remove the part after the ! ++ fileURL = fileURL.substring(0, fileURL.indexOf('!')); ++ ++ u = new URL(fileURL); ++ ++ } catch (Exception e) { ++ // Fail silently. In this case, url stays what it was above ++ } ++ ++ } ++ + if (u != null && u.getProtocol().equals("file")) { + boolean isLocalFile = false; + String host = u.getHost();