author | ssahoo |
Thu, 25 Jan 2018 05:57:22 -0800 | |
changeset 48668 | 2da4a52715d8 |
parent 47216 | 71c04702a3d5 |
child 50750 | 45511dcfed3f |
permissions | -rw-r--r-- |
31817
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
1 |
/* |
48668 | 2 |
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
31817
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
4 |
* |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
8 |
* |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
13 |
* accompanied this code). |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
14 |
* |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
18 |
* |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
21 |
* questions. |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
22 |
*/ |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
23 |
|
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
24 |
/* |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
25 |
* @test |
48668 | 26 |
* @bug 8131051 8194486 |
31817
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
27 |
* @summary KDC might issue a renewable ticket even if not requested |
48668 | 28 |
* @library /test/lib |
31817
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
29 |
* @compile -XDignore.symbol.file LongLife.java |
48668 | 30 |
* @run main jdk.test.lib.FileInstaller TestHosts TestHosts |
31 |
* @run main/othervm -Djdk.net.hosts.file=TestHosts LongLife |
|
31817
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
32 |
*/ |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
33 |
|
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
34 |
import sun.security.krb5.Config; |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
35 |
|
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
36 |
public class LongLife { |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
37 |
|
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
38 |
public static void main(String[] args) throws Exception { |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
39 |
|
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
40 |
OneKDC kdc = new OneKDC(null).writeJAASConf(); |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
41 |
|
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
42 |
// A lifetime 2d will make it renewable |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
43 |
KDC.saveConfig(OneKDC.KRB5_CONF, kdc, |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
44 |
"ticket_lifetime = 2d"); |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
45 |
Config.refresh(); |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
46 |
|
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
47 |
Context.fromJAAS("client"); |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
48 |
} |
1cd8bae1ef0c
8131051: KDC might issue a renewable ticket even if not requested
weijun
parents:
diff
changeset
|
49 |
} |