Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
5b3a1ff4
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
5b3a1ff4
编写于
3月 28, 2011
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7019384: Realm.getRealmsList returns realms list in wrong (reverse) order
Reviewed-by: xuelei
上级
b5526742
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
24 deletion
+40
-24
src/share/classes/sun/security/krb5/Realm.java
src/share/classes/sun/security/krb5/Realm.java
+16
-16
test/sun/security/krb5/ParseCAPaths.java
test/sun/security/krb5/ParseCAPaths.java
+14
-8
test/sun/security/krb5/krb5-capaths.conf
test/sun/security/krb5/krb5-capaths.conf
+10
-0
未找到文件。
src/share/classes/sun/security/krb5/Realm.java
浏览文件 @
5b3a1ff4
/*
* Copyright (c) 2000, 20
09
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 20
11
, 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
...
...
@@ -362,19 +362,15 @@ public class Realm implements Cloneable {
Stack
<
String
>
iStack
=
new
Stack
<>();
/*
* I don't expect any more than a handful of intermediaries.
* The half-established reversed-path, starting from the final target
* (sRealm), each item can be connected to by the next one.
* Might contains wrong item, if found, a bad track is performed
*/
Vector
<
String
>
tempList
=
new
Vector
<>(
8
,
8
);
/*
* The initiator at first location.
*/
tempList
.
add
(
cRealm
);
tempList
.
add
(
sRealm
);
int
count
=
0
;
// For debug only
if
(
DEBUG
)
{
tempTarget
=
sRealm
;
}
tempTarget
=
sRealm
;
out:
do
{
if
(
DEBUG
)
{
...
...
@@ -384,8 +380,8 @@ public class Realm implements Cloneable {
}
if
(
intermediaries
!=
null
&&
!
intermediaries
.
equals
(
PrincipalName
.
REALM_COMPONENT_SEPARATOR_STR
))
{
!
intermediaries
.
equals
(
"."
)
&&
!
intermediaries
.
equals
(
cRealm
))
{
if
(
DEBUG
)
{
System
.
out
.
println
(
">>> Realm parseCapaths: loop "
+
count
+
": intermediaries=["
+
...
...
@@ -466,11 +462,15 @@ public class Realm implements Cloneable {
}
while
(
true
);
if
(
tempList
.
isEmpty
())
{
return
null
;
}
// From (SREALM, T1, T2) to (CREALM, T2, T1)
retList
=
new
String
[
tempList
.
size
()];
try
{
retList
=
tempList
.
toArray
(
retList
);
}
catch
(
ArrayStoreException
exc
)
{
retList
=
null
;
retList
[
0
]
=
cRealm
;
for
(
int
i
=
1
;
i
<
tempList
.
size
();
i
++)
{
retList
[
i
]
=
tempList
.
elementAt
(
tempList
.
size
()-
i
);
}
if
(
DEBUG
&&
retList
!=
null
)
{
...
...
test/sun/security/krb5/ParseCAPaths.java
浏览文件 @
5b3a1ff4
/*
* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2009,
2011,
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
...
...
@@ -23,6 +23,7 @@
/*
* @test
* @bug 6789935
* @run main/othervm ParseCAPaths
* @summary cross-realm capath search error
*/
...
...
@@ -30,9 +31,10 @@ import java.util.Arrays;
import
sun.security.krb5.Realm
;
public
class
ParseCAPaths
{
static
boolean
failed
=
false
;
static
Exception
failed
=
null
;
public
static
void
main
(
String
[]
args
)
throws
Exception
{
System
.
setProperty
(
"java.security.krb5.conf"
,
System
.
getProperty
(
"test.src"
,
"."
)
+
"/krb5-capaths.conf"
);
System
.
setProperty
(
"java.security.krb5.conf"
,
System
.
getProperty
(
"test.src"
,
"."
)
+
"/krb5-capaths.conf"
);
//System.setProperty("sun.security.krb5.debug", "true");
// Standard example
...
...
@@ -59,9 +61,13 @@ public class ParseCAPaths {
check
(
"G1.COM"
,
"G3.COM"
,
"G1.COM"
,
"COM"
);
check
(
"H1.COM"
,
"H3.COM"
,
"H1.COM"
);
check
(
"I1.COM"
,
"I4.COM"
,
"I1.COM"
,
"I5.COM"
);
if
(
failed
)
{
throw
new
Exception
(
"Failed somewhere."
);
// J2=J1 is the same as J2=.
check
(
"J1.COM"
,
"J2.COM"
,
"J1.COM"
);
// 7019384
check
(
"A9.PRAGUE.XXX.CZ"
,
"SERVIS.XXX.CZ"
,
"A9.PRAGUE.XXX.CZ"
,
"PRAGUE.XXX.CZ"
,
"ROOT.XXX.CZ"
);
if
(
failed
!=
null
)
{
throw
failed
;
}
}
...
...
@@ -69,10 +75,10 @@ public class ParseCAPaths {
try
{
check2
(
from
,
to
,
paths
);
}
catch
(
Exception
e
)
{
failed
=
true
;
e
.
printStackTrace
();
failed
=
e
;
}
}
static
void
check2
(
String
from
,
String
to
,
String
...
paths
)
throws
Exception
{
System
.
out
.
println
(
from
+
" -> "
+
to
);
...
...
test/sun/security/krb5/krb5-capaths.conf
浏览文件 @
5b3a1ff4
...
...
@@ -85,3 +85,13 @@ I1.COM = {
I3
.
COM
=
I2
.
COM
I4
.
COM
=
I2
.
COM
I5
.
COM
}
J1
.
COM
= {
J2
.
COM
=
J1
.
COM
}
A9
.
PRAGUE
.
XXX
.
CZ
= {
PRAGUE
.
XXX
.
CZ
= .
ROOT
.
XXX
.
CZ
=
PRAGUE
.
XXX
.
CZ
SERVIS
.
XXX
.
CZ
=
ROOT
.
XXX
.
CZ
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录