Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
81b5273c
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
81b5273c
编写于
1月 20, 2009
作者:
M
mchung
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
9e1846ca
e78a9b26
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
85 addition
and
56 deletion
+85
-56
src/share/classes/java/net/DatagramSocket.java
src/share/classes/java/net/DatagramSocket.java
+17
-7
src/share/classes/java/util/Collection.java
src/share/classes/java/util/Collection.java
+1
-1
src/share/classes/java/util/Random.java
src/share/classes/java/util/Random.java
+1
-1
src/share/classes/sun/security/krb5/Config.java
src/share/classes/sun/security/krb5/Config.java
+51
-31
src/windows/native/sun/security/krb5/WindowsDirectory.c
src/windows/native/sun/security/krb5/WindowsDirectory.c
+15
-16
未找到文件。
src/share/classes/java/net/DatagramSocket.java
浏览文件 @
81b5273c
...
...
@@ -41,10 +41,11 @@ import java.security.PrivilegedExceptionAction;
* one machine to another may be routed differently, and may arrive in
* any order.
*
* <p>UDP broadcasts sends are always enabled on a DatagramSocket.
* In order to receive broadcast packets a DatagramSocket
* should be bound to the wildcard address. In some
* implementations, broadcast packets may also be received when
* <p> Where possible, a newly constructed {@code DatagramSocket} has the
* {@link SocketOptions#SO_BROADCAST SO_BROADCAST} socket option enabled so as
* to allow the transmission of broadcast datagrams. In order to receive
* broadcast packets a DatagramSocket should be bound to the wildcard address.
* In some implementations, broadcast packets may also be received when
* a DatagramSocket is bound to a more specific address.
* <p>
* Example:
...
...
@@ -1017,9 +1018,18 @@ class DatagramSocket implements java.io.Closeable {
/**
* Enable/disable SO_BROADCAST.
* @param on whether or not to have broadcast turned on.
* @exception SocketException if there is an error
* in the underlying protocol, such as an UDP error.
*
* <p> Some operating systems may require that the Java virtual machine be
* started with implementation specific privileges to enable this option or
* send broadcast datagrams.
*
* @param on
* whether or not to have broadcast turned on.
*
* @throws SocketException
* if there is an error in the underlying protocol, such as an UDP
* error.
*
* @since 1.4
* @see #getBroadcast()
*/
...
...
src/share/classes/java/util/Collection.java
浏览文件 @
81b5273c
...
...
@@ -427,7 +427,7 @@ public interface Collection<E> extends Iterable<E> {
* contract for the <tt>Object.hashCode</tt> method, programmers should
* take note that any class that overrides the <tt>Object.equals</tt>
* method must also override the <tt>Object.hashCode</tt> method in order
* to satisfy the general contract for the <tt>Object.hashCode</tt>method.
* to satisfy the general contract for the <tt>Object.hashCode</tt>
method.
* In particular, <tt>c1.equals(c2)</tt> implies that
* <tt>c1.hashCode()==c2.hashCode()</tt>.
*
...
...
src/share/classes/java/util/Random.java
浏览文件 @
81b5273c
...
...
@@ -32,7 +32,7 @@ import sun.misc.Unsafe;
* An instance of this class is used to generate a stream of
* pseudorandom numbers. The class uses a 48-bit seed, which is
* modified using a linear congruential formula. (See Donald Knuth,
* <i>The Art of Computer Programming, Volume
3
</i>, Section 3.2.1.)
* <i>The Art of Computer Programming, Volume
2
</i>, Section 3.2.1.)
* <p>
* If two instances of {@code Random} are created with the same
* seed, and the same sequence of method calls is made for each, they
...
...
src/share/classes/sun/security/krb5/Config.java
浏览文件 @
81b5273c
/*
* Portions Copyright 2000-200
8
Sun Microsystems, Inc. All Rights Reserved.
* Portions Copyright 2000-200
9
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
...
...
@@ -74,7 +74,7 @@ public class Config {
private
String
defaultRealm
;
// default kdc realm.
// used for native interface
private
static
native
String
getWindowsDirectory
();
private
static
native
String
getWindowsDirectory
(
boolean
isSystem
);
/**
...
...
@@ -661,38 +661,37 @@ public class Config {
}
/**
* Gets the default configuration file name. The file will be searched
* in a list of possible loations in the following order:
* 1. the location and file name defined by system property
* "java.security.krb5.conf",
* 2. at Java home lib\security directory with "krb5.conf" name,
* 3. "krb5.ini" at Java home,
* 4. at windows directory with the name of "krb5.ini" for Windows,
* /etc/krb5/krb5.conf for Solaris, /etc/krb5.conf for Linux.
* Gets the default configuration file name. This method will never
* return null.
*
* If the system property "java.security.krb5.conf" is defined, we'll
* use its value, no matter if the file exists or not. Otherwise,
* the file will be searched in a list of possible loations in the
* following order:
*
* 1. at Java home lib\security directory with "krb5.conf" name,
* 2. at windows directory with the name of "krb5.ini" for Windows,
* /etc/krb5/krb5.conf for Solaris, /etc/krb5.conf otherwise.
*
* Note: When the Terminal Service is started in Windows (from 2003),
* there are two kinds of Windows directories: A system one (say,
* C:\Windows), and a user-private one (say, C:\Users\Me\Windows).
* We will first look for krb5.ini in the user-private one. If not
* found, try the system one instead.
*/
private
String
getFileName
()
{
String
name
=
java
.
security
.
AccessController
.
doPrivileged
(
new
sun
.
security
.
action
.
GetPropertyAction
(
"java.security.krb5.conf"
));
if
(
name
!=
null
)
{
boolean
temp
=
java
.
security
.
AccessController
.
doPrivileged
(
new
FileExistsAction
(
name
));
if
(
temp
)
return
name
;
}
else
{
if
(
name
==
null
)
{
name
=
java
.
security
.
AccessController
.
doPrivileged
(
new
sun
.
security
.
action
.
GetPropertyAction
(
"java.home"
))
+
File
.
separator
+
"lib"
+
File
.
separator
+
"security"
+
File
.
separator
+
"krb5.conf"
;
boolean
temp
=
java
.
security
.
AccessController
.
doPrivileged
(
new
FileExistsAction
(
name
));
if
(
temp
)
{
return
name
;
}
else
{
if
(!
fileExists
(
name
))
{
name
=
null
;
String
osname
=
java
.
security
.
AccessController
.
doPrivileged
(
new
sun
.
security
.
action
.
GetPropertyAction
(
"os.name"
));
...
...
@@ -703,19 +702,35 @@ public class Config {
// ignore exceptions
}
if
(
Credentials
.
alreadyLoaded
)
{
if
((
name
=
getWindowsDirectory
())
==
null
)
{
name
=
"c:\\winnt\\krb5.ini"
;
}
else
if
(
name
.
endsWith
(
"\\"
))
{
name
+=
"krb5.ini"
;
}
else
{
name
+=
"\\krb5.ini"
;
String
path
=
getWindowsDirectory
(
false
);
if
(
path
!=
null
)
{
if
(
path
.
endsWith
(
"\\"
))
{
path
=
path
+
"krb5.ini"
;
}
else
{
path
=
path
+
"\\krb5.ini"
;
}
if
(
fileExists
(
path
))
{
name
=
path
;
}
}
}
else
{
if
(
name
==
null
)
{
path
=
getWindowsDirectory
(
true
);
if
(
path
!=
null
)
{
if
(
path
.
endsWith
(
"\\"
))
{
path
=
path
+
"krb5.ini"
;
}
else
{
path
=
path
+
"\\krb5.ini"
;
}
name
=
path
;
}
}
}
if
(
name
==
null
)
{
name
=
"c:\\winnt\\krb5.ini"
;
}
}
else
if
(
osname
.
startsWith
(
"SunOS"
))
{
name
=
"/etc/krb5/krb5.conf"
;
}
else
if
(
osname
.
startsWith
(
"Linux"
))
{
}
else
{
name
=
"/etc/krb5.conf"
;
}
}
...
...
@@ -1171,6 +1186,11 @@ public class Config {
return
kdcs
;
}
private
boolean
fileExists
(
String
name
)
{
return
java
.
security
.
AccessController
.
doPrivileged
(
new
FileExistsAction
(
name
));
}
static
class
FileExistsAction
implements
java
.
security
.
PrivilegedAction
<
Boolean
>
{
...
...
src/windows/native/sun/security/krb5/WindowsDirectory.c
浏览文件 @
81b5273c
/*
* Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
* Copyright 2005
-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,6 +23,7 @@
* have any questions.
*/
#define UNICODE
#include <jni.h>
#include <windows.h>
#include <stdlib.h>
...
...
@@ -30,22 +31,20 @@
/*
* Class: sun_security_krb5_Config
* Method: getWindowsDirectory
* Signature: ()Ljava/lang/String;
* Signature: (
Z
)Ljava/lang/String;
*/
JNIEXPORT
jstring
JNICALL
Java_sun_security_krb5_Config_getWindowsDirectory
(
JNIEnv
*
env
,
jclass
configClass
)
{
LPTSTR
lpPath
=
NULL
;
UINT
uLength
;
jstring
path
=
NULL
;
if
(
uLength
=
GetWindowsDirectory
(
lpPath
,
0
))
{
lpPath
=
(
LPTSTR
)
malloc
(
sizeof
(
TCHAR
)
*
uLength
);
if
(
lpPath
!=
NULL
)
{
if
(
GetWindowsDirectory
(
lpPath
,
uLength
))
{
path
=
(
*
env
)
->
NewStringUTF
(
env
,
lpPath
);
}
free
(
lpPath
);
}
JNIEnv
*
env
,
jclass
configClass
,
jboolean
isSystem
)
{
TCHAR
lpPath
[
MAX_PATH
+
1
];
UINT
len
;
if
(
isSystem
)
{
len
=
GetSystemWindowsDirectory
(
lpPath
,
MAX_PATH
);
}
else
{
len
=
GetWindowsDirectory
(
lpPath
,
MAX_PATH
);
}
if
(
len
)
{
return
(
*
env
)
->
NewString
(
env
,
lpPath
,
len
);
}
else
{
return
NULL
;
}
return
path
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录