changeset 1734:18fa77d40df5

Fix policy evaluation to match the proprietary JDK.
author Deepak Bhole <dbhole@redhat.com>
date Fri, 16 Jul 2010 16:53:35 -0400
parents bcdcc12c519e
children f5cff4063cf3
files ChangeLog Makefile.am patches/icedtea-policy-evaluation.patch
diffstat 3 files changed, 41 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 <dbhole@redhat.com>
+
+	* patches/icedtea-policy-evaluation.patch: New patch. Fixes policy
+	evaluation to match the proprietary JDK.
+
 2010-07-13  Mark Wielaard  <mjw@redhat.com>
 
 	Reported by William Cohen <wcohen@redhat.com>
--- 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 \
--- /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();