Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d3f3c958
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
3
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d3f3c958
编写于
5月 01, 2011
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7040916: DynamicKeyTab test fails on Windows
Reviewed-by: xuelei
上级
7244d5ec
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
25 addition
and
22 deletion
+25
-22
src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
...share/classes/sun/security/krb5/internal/ktab/KeyTab.java
+18
-18
test/sun/security/krb5/auto/DynamicKeytab.java
test/sun/security/krb5/auto/DynamicKeytab.java
+7
-4
未找到文件。
src/share/classes/sun/security/krb5/internal/ktab/KeyTab.java
浏览文件 @
d3f3c958
...
...
@@ -92,10 +92,10 @@ public class KeyTab implements KeyTabConstants {
tabName
=
filename
;
try
{
lastModified
=
new
File
(
tabName
).
lastModified
();
KeyTabInputStream
kis
=
new
KeyTabInputStream
(
new
FileInputStream
(
filename
));
try
(
KeyTabInputStream
kis
=
new
KeyTabInputStream
(
new
FileInputStream
(
filename
)))
{
load
(
kis
);
kis
.
close
();
}
}
catch
(
FileNotFoundException
e
)
{
entries
.
clear
();
isMissing
=
true
;
...
...
@@ -439,10 +439,10 @@ public class KeyTab implements KeyTabConstants {
public
synchronized
static
KeyTab
create
(
String
name
)
throws
IOException
,
RealmException
{
KeyTabOutputStream
kos
=
new
KeyTabOutputStream
(
new
FileOutputStream
(
name
))
;
try
(
KeyTabOutputStream
kos
=
new
KeyTabOutputStream
(
new
FileOutputStream
(
name
))
)
{
kos
.
writeVersion
(
KRB5_KT_VNO
);
kos
.
close
();
}
return
new
KeyTab
(
name
);
}
...
...
@@ -450,13 +450,13 @@ public class KeyTab implements KeyTabConstants {
* Saves the file at the directory.
*/
public
synchronized
void
save
()
throws
IOException
{
KeyTabOutputStream
kos
=
new
KeyTabOutputStream
(
new
FileOutputStream
(
tabName
))
;
try
(
KeyTabOutputStream
kos
=
new
KeyTabOutputStream
(
new
FileOutputStream
(
tabName
))
)
{
kos
.
writeVersion
(
kt_vno
);
for
(
int
i
=
0
;
i
<
entries
.
size
();
i
++)
{
kos
.
writeEntry
(
entries
.
elementAt
(
i
));
}
kos
.
close
();
}
}
/**
...
...
@@ -519,9 +519,9 @@ public class KeyTab implements KeyTabConstants {
* @exception IOException.
*/
public
synchronized
void
createVersion
(
File
file
)
throws
IOException
{
KeyTabOutputStream
kos
=
new
KeyTabOutputStream
(
new
FileOutputStream
(
file
))
;
try
(
KeyTabOutputStream
kos
=
new
KeyTabOutputStream
(
new
FileOutputStream
(
file
))
)
{
kos
.
write16
(
KRB5_KT_VNO
);
kos
.
close
();
}
}
}
test/sun/security/krb5/auto/DynamicKeytab.java
浏览文件 @
d3f3c958
...
...
@@ -30,6 +30,8 @@
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
org.ietf.jgss.GSSException
;
import
sun.security.jgss.GSSUtil
;
import
sun.security.krb5.KrbException
;
...
...
@@ -47,8 +49,7 @@ public class DynamicKeytab {
OneKDC
k
=
new
OneKDC
(
null
);
k
.
writeJAASConf
();
new
File
(
OneKDC
.
KTAB
).
delete
();
Files
.
delete
(
Paths
.
get
(
OneKDC
.
KTAB
));
// Starts with no keytab
c
=
Context
.
fromJAAS
(
"client"
);
...
...
@@ -79,11 +80,13 @@ public class DynamicKeytab {
connect
();
// Test 5: invalid keytab file, should ignore
new
FileOutputStream
(
OneKDC
.
KTAB
).
write
(
"BADBADBAD"
.
getBytes
());
try
(
FileOutputStream
fos
=
new
FileOutputStream
(
OneKDC
.
KTAB
))
{
fos
.
write
(
"BADBADBAD"
.
getBytes
());
}
connect
();
// Test 6: delete keytab file, identical to revoke all
new
File
(
OneKDC
.
KTAB
).
delete
(
);
Files
.
delete
(
Paths
.
get
(
OneKDC
.
KTAB
)
);
try
{
connect
();
throw
new
Exception
(
"Should not success"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录