--- old/src/share/classes/java/lang/management/ManagementPermission.java Thu Dec 1 16:40:55 2011 +++ new/src/share/classes/java/lang/management/ManagementPermission.java Thu Dec 1 16:40:54 2011 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -63,6 +63,13 @@ * This allows malicious code to monitor runtime information and * uncover vulnerabilities. * + * + * diagnosticCommand + * Ability to execute diagnostic commands in the Java virtual machine. + * + * This allows an attacker to disturb the behavior of the Java virtual + * machine, stop some services or expose application information + * * * * @@ -88,7 +95,8 @@ /** * Constructs a ManagementPermission with the specified name. * - * @param name Permission name. Must be either "monitor" or "control". + * @param name Permission name. Must be either "monitor", "control" or + * "diagnosticCommand" * * @throws NullPointerException if name is null. * @throws IllegalArgumentException if name is empty or invalid. @@ -95,7 +103,8 @@ */ public ManagementPermission(String name) { super(name); - if (!name.equals("control") && !name.equals("monitor")) { + if (!name.equals("control") && !name.equals("monitor") + && !name.equals("diagnosticCommand")) { throw new IllegalArgumentException("name: " + name); } } @@ -103,7 +112,8 @@ /** * Constructs a new ManagementPermission object. * - * @param name Permission name. Must be either "monitor" or "control". + * @param name Permission name. Must be either "monitor", "control" or + * "diagnosticCommand" * @param actions Must be either null or the empty string. * * @throws NullPointerException if name is null. @@ -113,7 +123,8 @@ public ManagementPermission(String name, String actions) throws IllegalArgumentException { super(name); - if (!name.equals("control") && !name.equals("monitor")) { + if (!name.equals("control") && !name.equals("monitor") + && !name.equals("diagnosticCommand")) { throw new IllegalArgumentException("name: " + name); } if (actions != null && actions.length() > 0) {