view patches/security/20121016/7189490.patch @ 2593:6df81d93af9c

Add 2012/10/16 security updates. 2012-10-11 Andrew John Hughes <gnu.andrew@redhat.com> * Makefile.am: (SECURITY_PATCHES): Add new patches. * patches/ecj/override.patch: Add new cases in P11Key and RMIConnectionImpl introduced by security patches. * patches/ssl.patch: Removed old unneeded patch which breaks with this update. * patches/security/20111018/7092186.patch: Backport of patch added to OpenJDK6 by Oracle as part of the last security update but not included in the bundle delivered ahead of time. * patches/security/20121016/6631398.patch, * patches/security/20121016/7093490.patch, * patches/security/20121016/7143535.patch, * patches/security/20121016/7158801.patch, * patches/security/20121016/7167656.patch, * patches/security/20121016/7169884.patch, * patches/security/20121016/7169888.patch, * patches/security/20121016/7172522.patch, * patches/security/20121016/7176337.patch, * patches/security/20121016/7186286.patch, * patches/security/20121016/7189103.patch, * patches/security/20121016/7189490.patch, * patches/security/20121016/7189567.patch, * patches/security/20121016/7192975.patch, * patches/security/20121016/7195194.patch, * patches/security/20121016/7195917.patch, * patches/security/20121016/7195919.patch, * patches/security/20121016/7198296.patch, * patches/security/20121016/7198606.patch, * patches/security/20121016/hs20/7158800.patch, * patches/security/20121016/hs20/7158804.patch, * patches/security/20121016/original/7158800.patch, * patches/security/20121016/original/7158804.patch: New patches.
author Andrew John Hughes <ahughes@redhat.com>
date Fri, 12 Oct 2012 02:18:24 +0100
parents
children
line wrap: on
line source

# HG changeset patch
# User coffeys
# Date 1345121553 -3600
# Node ID 7fe230af5036c83eb337b3560821b97c6dec08c9
# Parent  b6a7a661db8a2141ebb2e79ba5739722d1be7bfd
7189490: More improvements to DomainCombiner checking
Reviewed-by: mullan

diff --git a/src/share/classes/java/security/AccessController.java b/src/share/classes/java/security/AccessController.java
--- openjdk/jdk/src/share/classes/java/security/AccessController.java
+++ openjdk/jdk/src/share/classes/java/security/AccessController.java
@@ -290,11 +290,11 @@
      */
     public static <T> T doPrivilegedWithCombiner(PrivilegedAction<T> action) {
 
-        DomainCombiner dc = null;
         AccessControlContext acc = getStackAccessControlContext();
-        if (acc == null || (dc = acc.getAssignedCombiner()) == null) {
-            return AccessController.doPrivileged(action, acc);
+        if (acc == null) {
+            return AccessController.doPrivileged(action);
         }
+        DomainCombiner dc = acc.getAssignedCombiner();
         return AccessController.doPrivileged(action, preserveCombiner(dc));
     }
 
@@ -386,11 +386,11 @@
     public static <T> T doPrivilegedWithCombiner
         (PrivilegedExceptionAction<T> action) throws PrivilegedActionException {
 
-        DomainCombiner dc = null;
         AccessControlContext acc = getStackAccessControlContext();
-        if (acc == null || (dc = acc.getAssignedCombiner()) == null) {
-            return AccessController.doPrivileged(action, acc);
+        if (acc == null) {
+            return AccessController.doPrivileged(action);
         }
+        DomainCombiner dc = acc.getAssignedCombiner();
         return AccessController.doPrivileged(action, preserveCombiner(dc));
     }
 
@@ -417,7 +417,12 @@
         // perform 'combine' on the caller of doPrivileged,
         // even if the caller is from the bootclasspath
         ProtectionDomain[] pds = new ProtectionDomain[] {callerPd};
-        return new AccessControlContext(combiner.combine(pds, null), combiner);
+        if (combiner == null) {
+            return new AccessControlContext(pds);
+        } else {
+            return new AccessControlContext(combiner.combine(pds, null),
+                                            combiner);
+        }
     }