< prev index next >
test/jdk/sun/security/provider/PolicyParser/PrincipalExpansionError.java
Print this page
rev 59383 : [mq]: final
*** 1,7 ****
/*
! * Copyright (c) 2000, 2014, 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.
--- 1,7 ----
/*
! * Copyright (c) 2000, 2020, 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.
*** 31,41 ****
/*
* This test is a bit complicated.
* 1) PrincipalExpansionError.java
* the test itself. this test creates a Subject with a
! * SolarisPrincipal("TestPrincipal") and calls doAs
* with a PrincipalExpansionErrorAction.
* 2) PrincipalExpansionErrorAction
* this action tries to read the file, /testfile
* 3) to run the test:
* a) jtreg -verbose:all -testjdk:<your_jdk>/build/sparc
--- 31,41 ----
/*
* This test is a bit complicated.
* 1) PrincipalExpansionError.java
* the test itself. this test creates a Subject with a
! * UnixPrincipal("TestPrincipal") and calls doAs
* with a PrincipalExpansionErrorAction.
* 2) PrincipalExpansionErrorAction
* this action tries to read the file, /testfile
* 3) to run the test:
* a) jtreg -verbose:all -testjdk:<your_jdk>/build/sparc
*** 51,68 ****
* with codebase test.classes, and the action
* will run with codebase test.src.
* e) the test is executed. permissions to read the file,
* /testfile, were granted to the PrincipalExpansionError.
* the policy entry for PrincipalExpansionErrorAction
! * running as SolarisPrincipal("TestPrincipal")
* was also granted the file permission,
! * but it has a bogus second SolarisPrincipal with
* a name that can't be property-expanded.
*
* the old behavior of the code would ignore the
* bogus entry and incorrectly grants the file permission
! * to SolarisPrincipal("TestPrincipal").
* the new behavior correctly ignores the entire
* policy entry.
* Please note that the jtreg needs to be granted
* allpermissions for this test to succeed. If the codebase
* for jtreg changes, the PrincipalExpansionError.policy
--- 51,68 ----
* with codebase test.classes, and the action
* will run with codebase test.src.
* e) the test is executed. permissions to read the file,
* /testfile, were granted to the PrincipalExpansionError.
* the policy entry for PrincipalExpansionErrorAction
! * running as UnixPrincipal("TestPrincipal")
* was also granted the file permission,
! * but it has a bogus second UnixPrincipal with
* a name that can't be property-expanded.
*
* the old behavior of the code would ignore the
* bogus entry and incorrectly grants the file permission
! * to UnixPrincipal("TestPrincipal").
* the new behavior correctly ignores the entire
* policy entry.
* Please note that the jtreg needs to be granted
* allpermissions for this test to succeed. If the codebase
* for jtreg changes, the PrincipalExpansionError.policy
*** 86,96 ****
Subject s = new Subject();
try {
Set principals = s.getPrincipals();
! principals.add(new SolarisPrincipal("TestPrincipal"));
} catch (SecurityException se) {
// test incorrectly set up
throw new SecurityException
("PrincipalExpansionError test incorrectly set up:" + se);
}
--- 86,96 ----
Subject s = new Subject();
try {
Set principals = s.getPrincipals();
! principals.add(new UnixPrincipal("TestPrincipal"));
} catch (SecurityException se) {
// test incorrectly set up
throw new SecurityException
("PrincipalExpansionError test incorrectly set up:" + se);
}
< prev index next >