This commit is contained in:
Sean Mullan 2012-11-26 08:34:25 -05:00
commit 033919cce4
8 changed files with 73 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, 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
@ -46,8 +46,8 @@ import java.lang.SecurityManager;
* convention follows the hierarchical property naming convention.
* Also, an asterisk
* may appear at the end of the name, following a ".", or by itself, to
* signify a wildcard match. For example: "foo.*" or "*" is valid,
* "*foo" or "a*b" is not valid.
* signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
* match, while "*foo" and "a*b" do not.
* <P>
* The following table lists all the possible SSLPermission target names,
* and for each provides a description of what the permission allows

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -41,8 +41,8 @@ import java.util.StringTokenizer;
* naming convention follows the hierarchical property naming convention.
* Also, an asterisk
* may appear at the end of the name, following a ".", or by itself, to
* signify a wildcard match. For example: "loadLibrary.*" or "*" is valid,
* "*loadLibrary" or "a*b" is not valid.
* signify a wildcard match. For example: "loadLibrary.*" and "*" signify a
* wildcard match, while "*loadLibrary" and "a*b" do not.
* <P>
* The following table lists all the possible RuntimePermission target names,
* and for each provides a description of what the permission allows

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
@ -40,8 +40,8 @@ import java.util.StringTokenizer;
* convention follows the hierarchical property naming convention.
* Also, an asterisk
* may appear at the end of the name, following a ".", or by itself, to
* signify a wildcard match. For example: "foo.*" or "*" is valid,
* "*foo" or "a*b" is not valid.
* signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
* match, while "*foo" and "a*b" do not.
* <P>
* The following table lists all the possible NetPermission target names,
* and for each provides a description of what the permission allows

View File

@ -46,8 +46,8 @@ import java.io.IOException;
* convention follows the hierarchical property naming convention.
* An asterisk may appear by itself, or if immediately preceded by a "."
* may appear at the end of the name, to signify a wildcard match.
* For example, "*" and "java.*" are valid, while "*java", "a*b",
* and "java*" are not valid.
* For example, "*" and "java.*" signify a wildcard match, while "*java", "a*b",
* and "java*" do not.
* <P>
* The action string (inherited from Permission) is unused.
* Thus, BasicPermission is commonly used as the base class for

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2012, 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
@ -49,8 +49,8 @@ import java.security.*;
* In addition, an asterisk
* may appear at the end of the name, following a ".", or by itself, to
* signify a wildcard match. For example: <code>loadLibrary.*</code>
* or <code>*</code> is valid,
* but <code>*loadLibrary</code> or <code>a*b</code> is not valid.
* and <code>*</code> signify a wildcard match,
* while <code>*loadLibrary</code> and <code>a*b</code> do not.
* <P>
* The following table lists all the possible <code>SQLPermission</code> target names.
* The table gives a description of what the permission allows

View File

@ -48,8 +48,8 @@ import sun.security.util.SecurityConstants;
* convention follows the hierarchical property naming convention.
* Also, an asterisk
* may appear at the end of the name, following a ".", or by itself, to
* signify a wildcard match. For example: "java.*" or "*" is valid,
* "*java" or "a*b" is not valid.
* signify a wildcard match. For example: "java.*" and "*" signify a wildcard
* match, while "*java" and "a*b" do not.
* <P>
* <P>
* The actions to be granted are passed to the constructor in a string containing

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, 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
@ -37,8 +37,8 @@ import java.security.*;
* convention follows the hierarchical property naming convention.
* Also, an asterisk
* may appear at the end of the name, following a ".", or by itself, to
* signify a wildcard match. For example: "foo.*" or "*" is valid,
* "*foo" or "a*b" is not valid.
* signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
* match, while "*foo" and "a*b" do not.
* <P>
* The following table lists all the possible SSLPermission target names,
* and for each provides a description of what the permission allows

View File

@ -0,0 +1,54 @@
/*
* Copyright (c) 2012, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.lang.RuntimePermission;
import java.net.NetPermission;
import java.sql.SQLPermission;
import java.util.PropertyPermission;
import javax.net.ssl.SSLPermission;
/*
* @test
* @bug 7167056
* @summary Check that BasicPermission subclasses don't throw exception if name
* contains wildcard character ("*") but does not signify a
* wildcard match
*/
public class Wildcard {
public static void main(String[] args) throws Exception {
wildcard("*java");
wildcard("java*");
wildcard("ja*va");
}
private static void wildcard(String wildcard) throws Exception {
new RuntimePermission(wildcard);
new NetPermission(wildcard);
new SQLPermission(wildcard);
new PropertyPermission(wildcard, "read");
new SSLPermission(wildcard);
new com.sun.net.ssl.SSLPermission(wildcard);
}
}