Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
37496645
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看板
提交
37496645
编写于
10月 02, 2009
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6874472: display address lists for tickets in klist tool
Reviewed-by: valeriep
上级
d31ac944
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
13 deletion
+39
-13
src/windows/classes/sun/security/krb5/internal/tools/Klist.java
...ndows/classes/sun/security/krb5/internal/tools/Klist.java
+39
-13
未找到文件。
src/windows/classes/sun/security/krb5/internal/tools/Klist.java
浏览文件 @
37496645
...
...
@@ -30,17 +30,12 @@
package
sun.security.krb5.internal.tools
;
import
java.net.InetAddress
;
import
sun.security.krb5.*
;
import
sun.security.krb5.internal.*
;
import
sun.security.krb5.internal.ccache.*
;
import
sun.security.krb5.internal.ktab.*
;
import
sun.security.krb5.internal.crypto.EType
;
import
sun.security.krb5.KrbCryptoException
;
import
java.lang.RuntimeException
;
import
java.io.IOException
;
import
java.io.BufferedReader
;
import
java.io.InputStreamReader
;
import
java.io.File
;
/**
* This class can execute as a command-line tool to list entries in
...
...
@@ -51,9 +46,9 @@ import java.io.File;
*/
public
class
Klist
{
Object
target
;
// for credentials cache, options are 'f'
and 'e
';
// for credentials cache, options are 'f'
, 'e', 'a' and 'n
';
// for keytab, optionsare 't' and 'K' and 'e'
char
[]
options
=
new
char
[
3
];
char
[]
options
=
new
char
[
4
];
String
name
;
// the name of credentials cache and keytable.
char
action
;
// actions would be 'c' for credentials cache
// and 'k' for keytable.
...
...
@@ -62,7 +57,7 @@ public class Klist {
/**
* The main program that can be invoked at command line.
* <br>Usage: klist
* [[-c] [-f] [-e]] [-k [-t] [-K]] [name]
* [[-c] [-f] [-e]
[-a [-n]]
] [-k [-t] [-K]] [name]
* -c specifes that credential cache is to be listed
* -k specifies that key tab is to be listed
* name name of the credentials cache or keytab
...
...
@@ -70,6 +65,8 @@ public class Klist {
* <ul>
* <li><b>-f</b> shows credentials flags
* <li><b>-e</b> shows the encryption type
* <li><b>-a</b> shows addresses
* <li><b>-n</b> do not reverse-resolve addresses
* </ul>
* available options for keytabs:
* <li><b>-t</b> shows keytab entry timestamps
...
...
@@ -141,6 +138,12 @@ public class Klist {
case
'k'
:
action
=
'k'
;
break
;
case
'a'
:
options
[
2
]
=
'a'
;
break
;
case
'n'
:
options
[
3
]
=
'n'
;
break
;
case
'f'
:
options
[
1
]
=
'f'
;
break
;
...
...
@@ -202,7 +205,7 @@ public class Klist {
}
if
(
options
[
2
]
==
't'
)
{
System
.
out
.
println
(
"\t Time stamp: "
+
reformat
(
entries
[
i
].
getTimeStamp
().
toDate
().
toString
()));
reformat
(
entries
[
i
].
getTimeStamp
().
toDate
().
toString
()));
}
}
}
...
...
@@ -249,12 +252,33 @@ public class Klist {
System
.
out
.
println
(
" Expires: "
+
endtime
);
if
(
options
[
0
]
==
'e'
)
{
etype
=
EType
.
toString
(
creds
[
i
].
getEType
());
System
.
out
.
println
(
"
\t
Encryption type: "
+
etype
);
System
.
out
.
println
(
"
Encryption type: "
+
etype
);
}
if
(
options
[
1
]
==
'f'
)
{
System
.
out
.
println
(
"
\t
Flags: "
+
System
.
out
.
println
(
"
Flags: "
+
creds
[
i
].
getTicketFlags
().
toString
());
}
if
(
options
[
2
]
==
'a'
)
{
boolean
first
=
true
;
InetAddress
[]
caddr
=
creds
[
i
].
setKrbCreds
().
getClientAddresses
();
if
(
caddr
!=
null
)
{
for
(
InetAddress
ia:
caddr
)
{
String
out
;
if
(
options
[
3
]
==
'n'
)
{
out
=
ia
.
getHostAddress
();
}
else
{
out
=
ia
.
getCanonicalHostName
();
}
System
.
out
.
println
(
" "
+
(
first
?
"Addresses:"
:
" "
)
+
" "
+
out
);
first
=
false
;
}
}
else
{
System
.
out
.
println
(
" [No host addresses info]"
);
}
}
}
catch
(
RealmException
e
)
{
System
.
out
.
println
(
"Error reading principal from "
+
"the entry."
);
...
...
@@ -295,7 +319,7 @@ public class Klist {
*/
void
printHelp
()
{
System
.
out
.
println
(
"\nUsage: klist "
+
"[[-c] [-f] [-e]] [-k [-t] [-K]] [name]"
);
"[[-c] [-f] [-e]
[-a [-n]]
] [-k [-t] [-K]] [name]"
);
System
.
out
.
println
(
" name\t name of credentials cache or "
+
" keytab with the prefix. File-based cache or "
+
"keytab's prefix is FILE:."
);
...
...
@@ -305,6 +329,8 @@ public class Klist {
System
.
out
.
println
(
" options for credentials caches:"
);
System
.
out
.
println
(
"\t-f \t shows credentials flags"
);
System
.
out
.
println
(
"\t-e \t shows the encryption type"
);
System
.
out
.
println
(
"\t-a \t shows addresses"
);
System
.
out
.
println
(
"\t -n \t do not reverse-resolve addresses"
);
System
.
out
.
println
(
" options for keytabs:"
);
System
.
out
.
println
(
"\t-t \t shows keytab entry timestamps"
);
System
.
out
.
println
(
"\t-K \t shows keytab entry key value"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录