Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
245e7452
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看板
提交
245e7452
编写于
3月 23, 2013
作者:
W
weijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8009875: Provide a default udp_preference_limit for krb5.conf
Reviewed-by: valeriep
上级
a8554a29
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
84 addition
and
8 deletion
+84
-8
src/share/classes/sun/security/krb5/KdcComm.java
src/share/classes/sun/security/krb5/KdcComm.java
+10
-3
src/share/classes/sun/security/krb5/internal/Krb5.java
src/share/classes/sun/security/krb5/internal/Krb5.java
+2
-0
test/sun/security/krb5/auto/KDC.java
test/sun/security/krb5/auto/KDC.java
+5
-5
test/sun/security/krb5/config/DefUdpLimit.java
test/sun/security/krb5/config/DefUdpLimit.java
+67
-0
未找到文件。
src/share/classes/sun/security/krb5/KdcComm.java
浏览文件 @
245e7452
...
...
@@ -138,7 +138,7 @@ public final class KdcComm {
int
timeout
=
-
1
;
int
max_retries
=
-
1
;
int
ud
f
_pref_limit
=
-
1
;
int
ud
p
_pref_limit
=
-
1
;
try
{
Config
cfg
=
Config
.
getInstance
();
...
...
@@ -147,7 +147,7 @@ public final class KdcComm {
temp
=
cfg
.
get
(
"libdefaults"
,
"max_retries"
);
max_retries
=
parsePositiveIntString
(
temp
);
temp
=
cfg
.
get
(
"libdefaults"
,
"udp_preference_limit"
);
ud
f
_pref_limit
=
parsePositiveIntString
(
temp
);
ud
p
_pref_limit
=
parsePositiveIntString
(
temp
);
}
catch
(
Exception
exc
)
{
// ignore any exceptions; use default values
if
(
DEBUG
)
{
...
...
@@ -159,7 +159,14 @@ public final class KdcComm {
defaultKdcTimeout
=
timeout
>
0
?
timeout
:
30
*
1000
;
// 30 seconds
defaultKdcRetryLimit
=
max_retries
>
0
?
max_retries
:
Krb5
.
KDC_RETRY_LIMIT
;
defaultUdpPrefLimit
=
udf_pref_limit
;
if
(
udp_pref_limit
<
0
)
{
defaultUdpPrefLimit
=
Krb5
.
KDC_DEFAULT_UDP_PREF_LIMIT
;
}
else
if
(
udp_pref_limit
>
Krb5
.
KDC_HARD_UDP_LIMIT
)
{
defaultUdpPrefLimit
=
Krb5
.
KDC_HARD_UDP_LIMIT
;
}
else
{
defaultUdpPrefLimit
=
udp_pref_limit
;
}
KdcAccessibility
.
reset
();
}
...
...
src/share/classes/sun/security/krb5/internal/Krb5.java
浏览文件 @
245e7452
...
...
@@ -130,6 +130,8 @@ public class Krb5 {
// number of retries before giving up
public
static
final
int
KDC_RETRY_LIMIT
=
3
;
public
static
final
int
KDC_DEFAULT_UDP_PREF_LIMIT
=
1465
;
public
static
final
int
KDC_HARD_UDP_LIMIT
=
32700
;
//OSI authentication mechanism OID
...
...
test/sun/security/krb5/auto/KDC.java
浏览文件 @
245e7452
...
...
@@ -923,29 +923,29 @@ public class KDC {
pas2
=
new
DerValue
[]
{
new
DerValue
(
new
ETypeInfo2
(
1
,
null
,
null
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo2
(
1
,
""
,
null
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo2
(
1
,
OneKDC
.
REALM
,
new
byte
[]{
1
}).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo2
(
1
,
realm
,
new
byte
[]{
1
}).
asn1Encode
()),
};
pas
=
new
DerValue
[]
{
new
DerValue
(
new
ETypeInfo
(
1
,
null
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo
(
1
,
""
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo
(
1
,
OneKDC
.
REALM
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo
(
1
,
realm
).
asn1Encode
()),
};
break
;
case
2
:
// we still reject non-null s2kparams and prefer E2 over E
pas2
=
new
DerValue
[]
{
new
DerValue
(
new
ETypeInfo2
(
1
,
OneKDC
.
REALM
,
new
byte
[]{
1
}).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo2
(
1
,
realm
,
new
byte
[]{
1
}).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo2
(
1
,
null
,
null
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo2
(
1
,
""
,
null
).
asn1Encode
()),
};
pas
=
new
DerValue
[]
{
new
DerValue
(
new
ETypeInfo
(
1
,
OneKDC
.
REALM
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo
(
1
,
realm
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo
(
1
,
null
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo
(
1
,
""
).
asn1Encode
()),
};
break
;
case
3
:
// but only E is wrong
pas
=
new
DerValue
[]
{
new
DerValue
(
new
ETypeInfo
(
1
,
OneKDC
.
REALM
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo
(
1
,
realm
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo
(
1
,
null
).
asn1Encode
()),
new
DerValue
(
new
ETypeInfo
(
1
,
""
).
asn1Encode
()),
};
...
...
test/sun/security/krb5/config/DefUdpLimit.java
0 → 100644
浏览文件 @
245e7452
/*
* Copyright (c) 2013, Oracle and/or its affiliates. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @bug 8009875
* @summary Provide a default udp_preference_limit for krb5.conf
* @compile -XDignore.symbol.file DefUdpLimit.java
* @run main/othervm DefUdpLimit -1 1465
* @run main/othervm DefUdpLimit 0 0
* @run main/othervm DefUdpLimit 1234 1234
* @run main/othervm DefUdpLimit 12345 12345
* @run main/othervm DefUdpLimit 123456 32700
*
*/
import
sun.security.krb5.KdcComm
;
import
java.lang.reflect.Field
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
public
class
DefUdpLimit
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
int
set
=
Integer
.
valueOf
(
args
[
0
]);
int
expected
=
Integer
.
valueOf
(
args
[
1
]);
Field
f
=
KdcComm
.
class
.
getDeclaredField
(
"defaultUdpPrefLimit"
);
f
.
setAccessible
(
true
);
writeConf
(
set
);
int
actual
=
(
Integer
)
f
.
get
(
null
);
if
(
actual
!=
expected
)
{
throw
new
Exception
(
"Expected: "
+
expected
+
", get "
+
actual
);
}
}
static
void
writeConf
(
int
i
)
throws
Exception
{
String
file
=
"krb5.conf."
+
i
;
String
content
=
"[libdefaults]\n"
;
if
(
i
>=
0
)
{
content
+=
"udp_preference_limit = "
+
i
;
}
Files
.
write
(
Paths
.
get
(
file
),
content
.
getBytes
());
System
.
setProperty
(
"java.security.krb5.conf"
,
file
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录