Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
0e131c43
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看板
提交
0e131c43
编写于
10月 23, 2012
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8001208: Fix for KRB5CCNAME not complete
Reviewed-by: xuelei
上级
068784b7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
5 deletion
+24
-5
src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java
...n/security/krb5/internal/ccache/FileCredentialsCache.java
+10
-2
test/sun/security/krb5/ccache/EmptyCC.java
test/sun/security/krb5/ccache/EmptyCC.java
+14
-3
未找到文件。
src/share/classes/sun/security/krb5/internal/ccache/FileCredentialsCache.java
浏览文件 @
0e131c43
...
@@ -348,7 +348,7 @@ public class FileCredentialsCache extends CredentialsCache
...
@@ -348,7 +348,7 @@ public class FileCredentialsCache extends CredentialsCache
* Returns path name of the credentials cache file.
* Returns path name of the credentials cache file.
* The path name is searched in the following order:
* The path name is searched in the following order:
*
*
* 1. KRB5CCNAME
* 1. KRB5CCNAME
(bare file name without FILE:)
* 2. /tmp/krb5cc_<uid> on unix systems
* 2. /tmp/krb5cc_<uid> on unix systems
* 3. <user.home>/krb5cc_<user.name>
* 3. <user.home>/krb5cc_<user.name>
* 4. <user.home>/krb5cc (if can't get <user.name>)
* 4. <user.home>/krb5cc (if can't get <user.name>)
...
@@ -359,11 +359,19 @@ public class FileCredentialsCache extends CredentialsCache
...
@@ -359,11 +359,19 @@ public class FileCredentialsCache extends CredentialsCache
String
stdCacheNameComponent
=
"krb5cc"
;
String
stdCacheNameComponent
=
"krb5cc"
;
String
name
;
String
name
;
// The env var can start with TYPE:, we only support FILE: here.
// http://docs.oracle.com/cd/E19082-01/819-2252/6n4i8rtr3/index.html
name
=
java
.
security
.
AccessController
.
doPrivileged
(
name
=
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
String
>()
{
new
java
.
security
.
PrivilegedAction
<
String
>()
{
@Override
@Override
public
String
run
()
{
public
String
run
()
{
return
System
.
getenv
(
"KRB5CCNAME"
);
String
cache
=
System
.
getenv
(
"KRB5CCNAME"
);
if
(
cache
!=
null
&&
(
cache
.
length
()
>=
5
)
&&
cache
.
regionMatches
(
true
,
0
,
"FILE:"
,
0
,
5
))
{
cache
=
cache
.
substring
(
5
);
}
return
cache
;
}
}
});
});
if
(
name
!=
null
)
{
if
(
name
!=
null
)
{
...
...
test/sun/security/krb5/ccache/EmptyCC.java
浏览文件 @
0e131c43
...
@@ -24,9 +24,11 @@
...
@@ -24,9 +24,11 @@
/*
/*
* @test
* @test
* @bug 7158329
* @bug 7158329
* @bug 8001208
* @summary NPE in sun.security.krb5.Credentials.acquireDefaultCreds()
* @summary NPE in sun.security.krb5.Credentials.acquireDefaultCreds()
* @compile -XDignore.symbol.file EmptyCC.java
* @compile -XDignore.symbol.file EmptyCC.java
* @run main EmptyCC
* @run main EmptyCC tmpcc
* @run main EmptyCC FILE:tmpcc
*/
*/
import
java.io.File
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.io.InputStream
;
...
@@ -40,9 +42,9 @@ import sun.security.krb5.internal.ccache.CredentialsCache;
...
@@ -40,9 +42,9 @@ import sun.security.krb5.internal.ccache.CredentialsCache;
public
class
EmptyCC
{
public
class
EmptyCC
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
final
PrincipalName
pn
=
new
PrincipalName
(
"dummy@FOO.COM"
);
final
PrincipalName
pn
=
new
PrincipalName
(
"dummy@FOO.COM"
);
final
String
ccache
=
"tmpcc"
;
final
String
ccache
=
args
[
0
]
;
if
(
args
.
length
==
0
)
{
if
(
args
.
length
==
1
)
{
// Main process, write the ccache and launch sub process
// Main process, write the ccache and launch sub process
CredentialsCache
cache
=
CredentialsCache
.
create
(
pn
,
ccache
);
CredentialsCache
cache
=
CredentialsCache
.
create
(
pn
,
ccache
);
cache
.
save
();
cache
.
save
();
...
@@ -54,6 +56,7 @@ public class EmptyCC {
...
@@ -54,6 +56,7 @@ public class EmptyCC {
"-cp"
,
"-cp"
,
System
.
getProperty
(
"test.classes"
),
System
.
getProperty
(
"test.classes"
),
"EmptyCC"
,
"EmptyCC"
,
ccache
,
"readcc"
"readcc"
);
);
...
@@ -77,6 +80,14 @@ public class EmptyCC {
...
@@ -77,6 +80,14 @@ public class EmptyCC {
if
(!
cc
.
equals
(
ccache
))
{
if
(!
cc
.
equals
(
ccache
))
{
throw
new
Exception
(
"env not set correctly"
);
throw
new
Exception
(
"env not set correctly"
);
}
}
// 8001208: Fix for KRB5CCNAME not complete
// Make sure the ccache is created with bare file name
if
(
CredentialsCache
.
getInstance
()
==
null
)
{
throw
new
Exception
(
"Cache not instantiated"
);
}
if
(!
new
File
(
"tmpcc"
).
exists
())
{
throw
new
Exception
(
"File not found"
);
}
Credentials
.
acquireTGTFromCache
(
pn
,
null
);
Credentials
.
acquireTGTFromCache
(
pn
,
null
);
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录