Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7a33f3a6
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看板
提交
7a33f3a6
编写于
2月 03, 2009
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
6552334: Enable DNS in Kerberos by default
Reviewed-by: valeriep
上级
d51ccab4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
12 deletion
+18
-12
src/share/classes/sun/security/krb5/Config.java
src/share/classes/sun/security/krb5/Config.java
+8
-8
src/share/classes/sun/security/krb5/KrbServiceLocator.java
src/share/classes/sun/security/krb5/KrbServiceLocator.java
+2
-2
test/sun/security/krb5/DnsFallback.java
test/sun/security/krb5/DnsFallback.java
+8
-2
未找到文件。
src/share/classes/sun/security/krb5/Config.java
浏览文件 @
7a33f3a6
...
...
@@ -39,7 +39,6 @@ import java.io.BufferedReader;
import
java.io.InputStreamReader
;
import
java.io.IOException
;
import
java.util.Enumeration
;
import
java.util.List
;
import
java.util.StringTokenizer
;
import
java.net.InetAddress
;
import
java.net.UnknownHostException
;
...
...
@@ -156,11 +155,7 @@ public class Config {
configFile
=
loadConfigFile
();
stanzaTable
=
parseStanzaTable
(
configFile
);
}
catch
(
IOException
ioe
)
{
KrbException
ke
=
new
KrbException
(
"Could not load "
+
"configuration file "
+
ioe
.
getMessage
());
ke
.
initCause
(
ioe
);
throw
(
ke
);
// No krb5.conf, no problem. We'll use DNS etc.
}
}
}
...
...
@@ -1057,7 +1052,12 @@ public class Config {
public
boolean
useDNS
(
String
name
)
{
String
value
=
getDefault
(
name
,
"libdefaults"
);
if
(
value
==
null
)
{
return
getDefaultBooleanValue
(
"dns_fallback"
,
"libdefaults"
);
value
=
getDefault
(
"dns_fallback"
,
"libdefaults"
);
if
(
"false"
.
equalsIgnoreCase
(
value
))
{
return
false
;
}
else
{
return
true
;
}
}
else
{
return
value
.
equalsIgnoreCase
(
"true"
);
}
...
...
@@ -1117,7 +1117,7 @@ public class Config {
String
realm
=
null
;
String
hostName
=
null
;
try
{
hostName
=
InetAddress
.
getLocalHost
().
getHostName
();
hostName
=
InetAddress
.
getLocalHost
().
get
Canonical
HostName
();
}
catch
(
UnknownHostException
e
)
{
KrbException
ke
=
new
KrbException
(
Krb5
.
KRB_ERR_GENERIC
,
"Unable to locate Kerberos realm: "
+
e
.
getMessage
());
...
...
src/share/classes/sun/security/krb5/KrbServiceLocator.java
浏览文件 @
7a33f3a6
/*
* Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2006
-2009
Sun Microsystems, Inc. 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
...
...
@@ -133,7 +133,7 @@ class KrbServiceLocator {
*/
static
String
[]
getKerberosService
(
String
realmName
,
String
protocol
)
{
String
dnsUrl
=
"dns:///_kerberos."
+
protocol
+
realmName
;
String
dnsUrl
=
"dns:///_kerberos."
+
protocol
+
"."
+
realmName
;
String
[]
hostports
=
null
;
try
{
...
...
test/sun/security/krb5/DnsFallback.java
浏览文件 @
7a33f3a6
/*
* Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2008
-2009
Sun Microsystems, Inc. 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,7 +23,8 @@
/*
* @test
* @bug 6673164
* @summary dns_fallback parse error
* @bug 6552334
* @summary fix dns_fallback parse error, and use dns by default
*/
import
sun.security.krb5.*
;
...
...
@@ -31,6 +32,8 @@ import java.io.*;
public
class
DnsFallback
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// for 6673164
check
(
"true"
,
"true"
,
true
);
check
(
"false"
,
"true"
,
false
);
check
(
"true"
,
"false"
,
true
);
...
...
@@ -39,6 +42,9 @@ public class DnsFallback {
check
(
"false"
,
null
,
false
);
check
(
null
,
"true"
,
true
);
check
(
null
,
"false"
,
false
);
// for 6552334
check
(
null
,
null
,
true
);
}
static
void
check
(
String
realm
,
String
fallback
,
boolean
output
)
throws
Exception
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录