author | duke |
Wed, 05 Jul 2017 22:06:37 +0200 | |
changeset 40471 | ad45133ff99e |
parent 22965 | 78610fb00fff |
child 46151 | 5fa789776f7d |
permissions | -rw-r--r-- |
548
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
1 |
#!/bin/sh |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
2 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
3 |
# |
5506 | 4 |
# Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. |
548
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
6 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
7 |
# This code is free software; you can redistribute it and/or modify it |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
9 |
# published by the Free Software Foundation. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
10 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
15 |
# accompanied this code). |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
16 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
20 |
# |
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
548
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
24 |
# |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
25 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
26 |
# @test |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
27 |
# @bug 6662775 |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
28 |
# @summary Tests queuePrintJob is sufficient permission. |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
29 |
# @run clean PrintSE |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
30 |
# @run build PrintSE |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
31 |
# @run compile PrintSE.java |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
32 |
# @run shell/timeout=300 PrintSE.sh |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
33 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
34 |
echo ------------------------------------------------------------- |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
35 |
echo Launching test for `basename $0 .sh` |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
36 |
echo ------------------------------------------------------------- |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
37 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
38 |
createJavaPolicyFile() |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
39 |
{ |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
40 |
cat << EOF > ${TESTCLASSES}/print.policy |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
41 |
grant { |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
42 |
permission java.lang.RuntimePermission "queuePrintJob"; |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
43 |
}; |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
44 |
EOF |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
45 |
} |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
46 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
47 |
createJavaPolicyFile |
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
48 |
|
22965
78610fb00fff
8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents:
5506
diff
changeset
|
49 |
${TESTJAVA}/bin/java ${TESTVMOPTS} \ |
78610fb00fff
8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents:
5506
diff
changeset
|
50 |
-Djava.security.manager \ |
78610fb00fff
8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents:
5506
diff
changeset
|
51 |
-Djava.security.policy=${TESTCLASSES}/print.policy \ |
78610fb00fff
8028711: TEST_BUG: Shell tests should pass through VM options
alanb
parents:
5506
diff
changeset
|
52 |
-cp ${TESTCLASSES} PrintSE |
548
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
53 |
|
caed182cee6e
6664915: SecurityException using javax.print APIs when queuePrintJob permission is granted.
prr
parents:
diff
changeset
|
54 |
exit $? |