Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
98c21618
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看板
提交
98c21618
编写于
2月 03, 2009
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6785456: Read Kerberos setting from Windows environment variables
Reviewed-by: valeriep
上级
7a33f3a6
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
62 addition
and
4 deletion
+62
-4
src/share/classes/sun/security/krb5/Config.java
src/share/classes/sun/security/krb5/Config.java
+62
-4
未找到文件。
src/share/classes/sun/security/krb5/Config.java
浏览文件 @
98c21618
...
...
@@ -1079,12 +1079,39 @@ public class Config {
/**
* Gets default realm.
* @throws KrbException where no realm can be located
* @return the default realm, always non null
*/
public
String
getDefaultRealm
()
throws
KrbException
{
Exception
cause
=
null
;
String
realm
=
getDefault
(
"default_realm"
,
"libdefaults"
);
if
((
realm
==
null
)
&&
useDNS_Realm
())
{
// use DNS to locate Kerberos realm
try
{
realm
=
getRealmFromDNS
();
}
catch
(
KrbException
ke
)
{
cause
=
ke
;
}
}
if
(
realm
==
null
)
{
realm
=
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
String
>()
{
@Override
public
String
run
()
{
String
osname
=
System
.
getProperty
(
"os.name"
);
if
(
osname
.
startsWith
(
"Windows"
))
{
return
System
.
getenv
(
"USERDNSDOMAIN"
);
}
return
null
;
}
});
}
if
(
realm
==
null
)
{
KrbException
ke
=
new
KrbException
(
"Cannot locate default realm"
);
if
(
cause
!=
null
)
{
ke
.
initCause
(
cause
);
}
throw
ke
;
}
return
realm
;
}
...
...
@@ -1092,17 +1119,48 @@ public class Config {
/**
* Returns a list of KDC's with each KDC separated by a space
*
* @param realm the realm for which the master KDC is desired
* @return the list of KDCs
* @param realm the realm for which the KDC list is desired
* @throws KrbException if there's no way to find KDC for the realm
* @return the list of KDCs separated by a space, always non null
*/
public
String
getKDCList
(
String
realm
)
throws
KrbException
{
if
(
realm
==
null
)
{
realm
=
getDefaultRealm
();
}
Exception
cause
=
null
;
String
kdcs
=
getDefault
(
"kdc"
,
realm
);
if
((
kdcs
==
null
)
&&
useDNS_KDC
())
{
// use DNS to locate KDC
try
{
kdcs
=
getKDCFromDNS
(
realm
);
}
catch
(
KrbException
ke
)
{
cause
=
ke
;
}
}
if
(
kdcs
==
null
)
{
kdcs
=
java
.
security
.
AccessController
.
doPrivileged
(
new
java
.
security
.
PrivilegedAction
<
String
>()
{
@Override
public
String
run
()
{
String
osname
=
System
.
getProperty
(
"os.name"
);
if
(
osname
.
startsWith
(
"Windows"
))
{
String
logonServer
=
System
.
getenv
(
"LOGONSERVER"
);
if
(
logonServer
!=
null
&&
logonServer
.
startsWith
(
"\\\\"
))
{
logonServer
=
logonServer
.
substring
(
2
);
}
return
logonServer
;
}
return
null
;
}
});
}
if
(
kdcs
==
null
)
{
KrbException
ke
=
new
KrbException
(
"Cannot locate KDC"
);
if
(
cause
!=
null
)
{
ke
.
initCause
(
cause
);
}
throw
ke
;
}
return
kdcs
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录