--- old/test/lib/security/java.policy/Ext_AllPolicy.java 2014-04-24 19:31:05.304595131 -0700 +++ new/test/lib/security/java.policy/Ext_AllPolicy.java 2014-04-24 19:31:05.144595128 -0700 @@ -31,11 +31,23 @@ public class Ext_AllPolicy { public static void main (String[] args) { + boolean allPerms = args.length == 1 && args[0].equals("AllPermission"); FilePermission mine = new FilePermission("/tmp/bar", "read"); SecurityManager sm = System.getSecurityManager(); if (sm != null) { + try { sm.checkPermission(mine); + if (!allPerms) { + // Default has no privilege. + throw new RuntimeException(mine + " expected to deny access"); + } + } catch (AccessControlException e) { + if (allPerms) { + // expected all permissions granted + throw e; + } + } } } }