Merge
This commit is contained in:
commit
033919cce4
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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.
|
* convention follows the hierarchical property naming convention.
|
||||||
* Also, an asterisk
|
* Also, an asterisk
|
||||||
* may appear at the end of the name, following a ".", or by itself, to
|
* may appear at the end of the name, following a ".", or by itself, to
|
||||||
* signify a wildcard match. For example: "foo.*" or "*" is valid,
|
* signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
|
||||||
* "*foo" or "a*b" is not valid.
|
* match, while "*foo" and "a*b" do not.
|
||||||
* <P>
|
* <P>
|
||||||
* The following table lists all the possible SSLPermission target names,
|
* The following table lists all the possible SSLPermission target names,
|
||||||
* and for each provides a description of what the permission allows
|
* and for each provides a description of what the permission allows
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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.
|
* naming convention follows the hierarchical property naming convention.
|
||||||
* Also, an asterisk
|
* Also, an asterisk
|
||||||
* may appear at the end of the name, following a ".", or by itself, to
|
* may appear at the end of the name, following a ".", or by itself, to
|
||||||
* signify a wildcard match. For example: "loadLibrary.*" or "*" is valid,
|
* signify a wildcard match. For example: "loadLibrary.*" and "*" signify a
|
||||||
* "*loadLibrary" or "a*b" is not valid.
|
* wildcard match, while "*loadLibrary" and "a*b" do not.
|
||||||
* <P>
|
* <P>
|
||||||
* The following table lists all the possible RuntimePermission target names,
|
* The following table lists all the possible RuntimePermission target names,
|
||||||
* and for each provides a description of what the permission allows
|
* and for each provides a description of what the permission allows
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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.
|
* convention follows the hierarchical property naming convention.
|
||||||
* Also, an asterisk
|
* Also, an asterisk
|
||||||
* may appear at the end of the name, following a ".", or by itself, to
|
* may appear at the end of the name, following a ".", or by itself, to
|
||||||
* signify a wildcard match. For example: "foo.*" or "*" is valid,
|
* signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
|
||||||
* "*foo" or "a*b" is not valid.
|
* match, while "*foo" and "a*b" do not.
|
||||||
* <P>
|
* <P>
|
||||||
* The following table lists all the possible NetPermission target names,
|
* The following table lists all the possible NetPermission target names,
|
||||||
* and for each provides a description of what the permission allows
|
* and for each provides a description of what the permission allows
|
||||||
|
@ -46,8 +46,8 @@ import java.io.IOException;
|
|||||||
* convention follows the hierarchical property naming convention.
|
* convention follows the hierarchical property naming convention.
|
||||||
* An asterisk may appear by itself, or if immediately preceded by a "."
|
* 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.
|
* may appear at the end of the name, to signify a wildcard match.
|
||||||
* For example, "*" and "java.*" are valid, while "*java", "a*b",
|
* For example, "*" and "java.*" signify a wildcard match, while "*java", "a*b",
|
||||||
* and "java*" are not valid.
|
* and "java*" do not.
|
||||||
* <P>
|
* <P>
|
||||||
* The action string (inherited from Permission) is unused.
|
* The action string (inherited from Permission) is unused.
|
||||||
* Thus, BasicPermission is commonly used as the base class for
|
* Thus, BasicPermission is commonly used as the base class for
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -49,8 +49,8 @@ import java.security.*;
|
|||||||
* In addition, an asterisk
|
* In addition, an asterisk
|
||||||
* may appear at the end of the name, following a ".", or by itself, to
|
* may appear at the end of the name, following a ".", or by itself, to
|
||||||
* signify a wildcard match. For example: <code>loadLibrary.*</code>
|
* signify a wildcard match. For example: <code>loadLibrary.*</code>
|
||||||
* or <code>*</code> is valid,
|
* and <code>*</code> signify a wildcard match,
|
||||||
* but <code>*loadLibrary</code> or <code>a*b</code> is not valid.
|
* while <code>*loadLibrary</code> and <code>a*b</code> do not.
|
||||||
* <P>
|
* <P>
|
||||||
* The following table lists all the possible <code>SQLPermission</code> target names.
|
* The following table lists all the possible <code>SQLPermission</code> target names.
|
||||||
* The table gives a description of what the permission allows
|
* The table gives a description of what the permission allows
|
||||||
|
@ -48,8 +48,8 @@ import sun.security.util.SecurityConstants;
|
|||||||
* convention follows the hierarchical property naming convention.
|
* convention follows the hierarchical property naming convention.
|
||||||
* Also, an asterisk
|
* Also, an asterisk
|
||||||
* may appear at the end of the name, following a ".", or by itself, to
|
* may appear at the end of the name, following a ".", or by itself, to
|
||||||
* signify a wildcard match. For example: "java.*" or "*" is valid,
|
* signify a wildcard match. For example: "java.*" and "*" signify a wildcard
|
||||||
* "*java" or "a*b" is not valid.
|
* match, while "*java" and "a*b" do not.
|
||||||
* <P>
|
* <P>
|
||||||
* <P>
|
* <P>
|
||||||
* The actions to be granted are passed to the constructor in a string containing
|
* The actions to be granted are passed to the constructor in a string containing
|
||||||
|
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* 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.
|
* convention follows the hierarchical property naming convention.
|
||||||
* Also, an asterisk
|
* Also, an asterisk
|
||||||
* may appear at the end of the name, following a ".", or by itself, to
|
* may appear at the end of the name, following a ".", or by itself, to
|
||||||
* signify a wildcard match. For example: "foo.*" or "*" is valid,
|
* signify a wildcard match. For example: "foo.*" and "*" signify a wildcard
|
||||||
* "*foo" or "a*b" is not valid.
|
* match, while "*foo" and "a*b" do not.
|
||||||
* <P>
|
* <P>
|
||||||
* The following table lists all the possible SSLPermission target names,
|
* The following table lists all the possible SSLPermission target names,
|
||||||
* and for each provides a description of what the permission allows
|
* and for each provides a description of what the permission allows
|
||||||
|
54
jdk/test/java/security/BasicPermission/Wildcard.java
Normal file
54
jdk/test/java/security/BasicPermission/Wildcard.java
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user