Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8af1c11d
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看板
提交
8af1c11d
编写于
2月 20, 2018
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
8914d4c6
cf987eaf
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
288 addition
and
13 deletion
+288
-13
.hgtags
.hgtags
+1
-0
src/share/classes/java/io/ObjectInputStream.java
src/share/classes/java/io/ObjectInputStream.java
+7
-3
src/share/classes/java/util/concurrent/PriorityBlockingQueue.java
...e/classes/java/util/concurrent/PriorityBlockingQueue.java
+4
-1
src/share/classes/javax/management/openmbean/TabularDataSupport.java
...lasses/javax/management/openmbean/TabularDataSupport.java
+5
-2
src/share/classes/sun/misc/Launcher.java
src/share/classes/sun/misc/Launcher.java
+14
-2
src/share/classes/sun/rmi/transport/tcp/TCPTransport.java
src/share/classes/sun/rmi/transport/tcp/TCPTransport.java
+9
-0
src/share/classes/sun/security/util/ManifestDigester.java
src/share/classes/sun/security/util/ManifestDigester.java
+8
-3
test/sun/rmi/transport/proxy/EagerHttpFallback.java
test/sun/rmi/transport/proxy/EagerHttpFallback.java
+3
-1
test/sun/rmi/transport/tcp/DisableRMIOverHttp/DisableRMIOverHTTPTest.java
...nsport/tcp/DisableRMIOverHttp/DisableRMIOverHTTPTest.java
+156
-0
test/sun/rmi/transport/tcp/DisableRMIOverHttp/TestIface.java
test/sun/rmi/transport/tcp/DisableRMIOverHttp/TestIface.java
+31
-0
test/sun/rmi/transport/tcp/DisableRMIOverHttp/TestImpl.java
test/sun/rmi/transport/tcp/DisableRMIOverHttp/TestImpl.java
+49
-0
test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java
test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java
+1
-1
未找到文件。
.hgtags
浏览文件 @
8af1c11d
...
...
@@ -864,6 +864,7 @@ c260afc0c5a13407aad4f066f81fba814bb0cbae jdk8u171-b03
ac700f67341a20ddae093c319da1c65e41edcacd jdk8u171-b04
863ef3413aa42c15fbdc14fef6732f2741f97046 jdk8u171-b05
6cbe2e5989a85f82833191be05ccb531f685d171 jdk8u171-b06
9cf14f22734a057adceff1764b4bb6c71329088b jdk8u171-b07
64df143be721d3ef031d765d86277c1e114d627a jdk8u172-b00
25f7b0cd25cf13106783050fc8e6f4a78487a7bd jdk8u172-b01
db8272cb8c99eea536a66c4c368c4bf2bf013a81 jdk8u172-b02
...
...
src/share/classes/java/io/ObjectInputStream.java
浏览文件 @
8af1c11d
/*
* Copyright (c) 1996, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 201
8
, 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
...
...
@@ -245,7 +245,7 @@ public class ObjectInputStream
static
{
/* Setup access so sun.misc can invoke package private functions. */
sun
.
misc
.
SharedSecrets
.
setJavaOISAccess
(
new
JavaOISAccess
()
{
JavaOISAccess
javaOISAccess
=
new
JavaOISAccess
()
{
public
void
setObjectInputFilter
(
ObjectInputStream
stream
,
ObjectInputFilter
filter
)
{
stream
.
setInternalObjectInputFilter
(
filter
);
}
...
...
@@ -259,7 +259,11 @@ public class ObjectInputStream
{
stream
.
checkArray
(
arrayType
,
arrayLength
);
}
});
};
sun
.
misc
.
SharedSecrets
.
setJavaOISAccess
(
javaOISAccess
);
sun
.
corba
.
SharedSecrets
.
setJavaOISAccess
(
javaOISAccess
);
}
/*
...
...
src/share/classes/java/util/concurrent/PriorityBlockingQueue.java
浏览文件 @
8af1c11d
...
...
@@ -48,6 +48,7 @@ import java.util.Queue;
import
java.util.SortedSet
;
import
java.util.Spliterator
;
import
java.util.function.Consumer
;
import
sun.misc.SharedSecrets
;
/**
* An unbounded {@linkplain BlockingQueue blocking queue} that uses
...
...
@@ -940,7 +941,9 @@ public class PriorityBlockingQueue<E> extends AbstractQueue<E>
throws
java
.
io
.
IOException
,
ClassNotFoundException
{
try
{
s
.
defaultReadObject
();
this
.
queue
=
new
Object
[
q
.
size
()];
int
sz
=
q
.
size
();
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
s
,
Object
[].
class
,
sz
);
this
.
queue
=
new
Object
[
sz
];
comparator
=
q
.
comparator
();
addAll
(
q
);
}
finally
{
...
...
src/share/classes/javax/management/openmbean/TabularDataSupport.java
浏览文件 @
8af1c11d
/*
* Copyright (c) 2000, 201
1
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 201
8
, 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
...
...
@@ -45,6 +45,7 @@ import java.util.LinkedHashMap;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
sun.misc.SharedSecrets
;
// jmx import
//
...
...
@@ -911,6 +912,8 @@ public class TabularDataSupport
throws
IOException
,
ClassNotFoundException
{
in
.
defaultReadObject
();
List
<
String
>
tmpNames
=
tabularType
.
getIndexNames
();
indexNamesArray
=
tmpNames
.
toArray
(
new
String
[
tmpNames
.
size
()]);
int
size
=
tmpNames
.
size
();
SharedSecrets
.
getJavaOISAccess
().
checkArray
(
in
,
String
[].
class
,
size
);
indexNamesArray
=
tmpNames
.
toArray
(
new
String
[
size
]);
}
}
src/share/classes/sun/misc/Launcher.java
浏览文件 @
8af1c11d
/*
* Copyright (c) 1998, 201
6
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
8
, 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
...
...
@@ -48,7 +48,7 @@ import sun.net.www.ParseUtil;
/**
* This class is used by the system to launch the main application.
Launcher
*/
*/
public
class
Launcher
{
private
static
URLStreamHandlerFactory
factory
=
new
Factory
();
private
static
Launcher
launcher
=
new
Launcher
();
...
...
@@ -121,6 +121,7 @@ public class Launcher {
static
{
ClassLoader
.
registerAsParallelCapable
();
}
private
static
volatile
ExtClassLoader
instance
=
null
;
/**
* create an ExtClassLoader. The ExtClassLoader is created
...
...
@@ -128,6 +129,17 @@ public class Launcher {
*/
public
static
ExtClassLoader
getExtClassLoader
()
throws
IOException
{
if
(
instance
==
null
)
{
synchronized
(
ExtClassLoader
.
class
)
{
if
(
instance
==
null
)
{
instance
=
createExtClassLoader
();
}
}
}
return
instance
;
}
private
static
ExtClassLoader
createExtClassLoader
()
throws
IOException
{
try
{
// Prior implementations of this doPrivileged() block supplied
// aa synthesized ACC via a call to the private method
...
...
src/share/classes/sun/rmi/transport/tcp/TCPTransport.java
浏览文件 @
8af1c11d
...
...
@@ -119,6 +119,11 @@ public class TCPTransport extends Transport {
}
});
private
static
final
boolean
disableIncomingHttp
=
java
.
security
.
AccessController
.
doPrivileged
(
new
GetPropertyAction
(
"java.rmi.server.disableIncomingHttp"
,
"true"
))
.
equalsIgnoreCase
(
"true"
);
/** total connections handled */
private
static
final
AtomicInteger
connectionCount
=
new
AtomicInteger
(
0
);
...
...
@@ -722,6 +727,10 @@ public class TCPTransport extends Transport {
int
magic
=
in
.
readInt
();
if
(
magic
==
POST
)
{
System
.
err
.
println
(
"DISABLED: "
+
disableIncomingHttp
);
if
(
disableIncomingHttp
)
{
throw
new
RemoteException
(
"RMI over HTTP is disabled"
);
}
tcpLog
.
log
(
Log
.
BRIEF
,
"decoding HTTP-wrapped call"
);
// It's really a HTTP-wrapped request. Repackage
...
...
src/share/classes/sun/security/util/ManifestDigester.java
浏览文件 @
8af1c11d
...
...
@@ -169,10 +169,15 @@ public class ManifestDigester {
}
}
entries
.
computeIfAbsent
(
nameBuf
.
toString
(),
dummy
->
new
Entry
())
Entry
e
=
entries
.
get
(
nameBuf
.
toString
());
if
(
e
==
null
)
{
entries
.
put
(
nameBuf
.
toString
(),
new
Entry
()
.
addSection
(
new
Section
(
start
,
sectionLen
,
sectionLenWithBlank
,
rawBytes
));
sectionLenWithBlank
,
rawBytes
)));
}
else
{
e
.
addSection
(
new
Section
(
start
,
sectionLen
,
sectionLenWithBlank
,
rawBytes
));
}
}
catch
(
java
.
io
.
UnsupportedEncodingException
uee
)
{
throw
new
IllegalStateException
(
...
...
test/sun/rmi/transport/proxy/EagerHttpFallback.java
浏览文件 @
8af1c11d
...
...
@@ -28,7 +28,7 @@
*
* @library ../../../../java/rmi/testlibrary
* @build TestLibrary
* @run main/othervm EagerHttpFallback
* @run main/othervm
-Djava.rmi.server.disableIncomingHttp=false
EagerHttpFallback
*/
import
java.rmi.*
;
...
...
@@ -46,6 +46,8 @@ public class EagerHttpFallback {
"true"
);
LocateRegistry
.
createRegistry
(
FALLBACK_PORT
);
System
.
err
.
println
(
"1-DISABLED: "
+
System
.
getProperty
(
"java.rmi.server.disableIncomingHttp"
));
/*
* The call below should trigger a ConnectException in the
* RMIMasterSocketFactory when it attempts a direct connection to
...
...
test/sun/rmi/transport/tcp/DisableRMIOverHttp/DisableRMIOverHTTPTest.java
0 → 100644
浏览文件 @
8af1c11d
/*
* Copyright (c) 2018, 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 8193833
*
* @summary Disable RMI over HTTP by default
*
* @library ../../../../../java/rmi/testlibrary
* @build TestIface TestImpl
* @run main/othervm/timeout=60 DisableRMIOverHTTPTest
* @run main/othervm/timeout=60 -Djava.rmi.server.disableIncomingHttp=false DisableRMIOverHTTPTest
*/
/*
* This test is an adaptation of ../blockAccept/BlockAcceptTest.java
*
* This test:
* 1. Creates an object and exports it.
* 2. Makes a regular call, using HTTP tunnelling.
* 3. Either throws an exception if RMI over HTTP is disabled or completes
* execution if not.
*/
import
java.rmi.*
;
import
java.rmi.server.RMISocketFactory
;
import
java.io.*
;
import
java.net.*
;
import
sun.rmi.transport.proxy.RMIMasterSocketFactory
;
import
sun.rmi.transport.proxy.RMIHttpToPortSocketFactory
;
public
class
DisableRMIOverHTTPTest
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// HTTP direct to the server port
System
.
setProperty
(
"http.proxyHost"
,
"127.0.0.1"
);
boolean
incomingHttpDisabled
=
Boolean
.
valueOf
(
System
.
getProperty
(
"java.rmi.server.disableIncomingHttp"
,
"true"
)
.
equalsIgnoreCase
(
"true"
));
// Set the socket factory.
System
.
err
.
println
(
"(installing HTTP-out socket factory)"
);
HttpOutFactory
fac
=
new
HttpOutFactory
();
RMISocketFactory
.
setSocketFactory
(
fac
);
// Create remote object
TestImpl
impl
=
new
TestImpl
();
// Export and get which port.
System
.
err
.
println
(
"(exporting remote object)"
);
TestIface
stub
=
impl
.
export
();
try
{
int
port
=
fac
.
whichPort
();
// Sanity
if
(
port
==
0
)
throw
new
Error
(
"TEST FAILED: export didn't reserve a port(?)"
);
// The test itself: make a remote call and see if it's blocked or
// if it works
//Thread.sleep(2000);
System
.
err
.
println
(
"(making RMI-through-HTTP call)"
);
String
result
=
stub
.
testCall
(
"dummy load"
);
System
.
err
.
println
(
" => "
+
result
);
if
(
"OK"
.
equals
(
result
))
{
if
(
incomingHttpDisabled
)
{
throw
new
Error
(
"TEST FAILED: should not receive result if incoming http is disabled"
);
}
}
else
{
if
(!
incomingHttpDisabled
)
{
throw
new
Error
(
"TEST FAILED: result not OK"
);
}
}
System
.
err
.
println
(
"Test passed."
);
}
catch
(
UnmarshalException
e
)
{
if
(!
incomingHttpDisabled
)
{
throw
e
;
}
else
{
System
.
err
.
println
(
"Test passed."
);
}
}
finally
{
try
{
impl
.
unexport
();
}
catch
(
Throwable
unmatter
)
{
}
}
// Should exit here
}
private
static
class
HttpOutFactory
extends
RMISocketFactory
{
private
int
servport
=
0
;
public
Socket
createSocket
(
String
h
,
int
p
)
throws
IOException
{
return
((
new
RMIHttpToPortSocketFactory
()).
createSocket
(
h
,
p
));
}
/** Create a server socket and remember which port it's on.
* Aborts if createServerSocket(0) is called twice, because then
* it doesn't know whether to remember the first or second port.
*/
public
ServerSocket
createServerSocket
(
int
p
)
throws
IOException
{
ServerSocket
ss
;
ss
=
(
new
RMIMasterSocketFactory
()).
createServerSocket
(
p
);
if
(
p
==
0
)
{
if
(
servport
!=
0
)
{
System
.
err
.
println
(
"TEST FAILED: "
+
"Duplicate createServerSocket(0)"
);
throw
new
Error
(
"Test aborted (createServerSocket)"
);
}
servport
=
ss
.
getLocalPort
();
}
return
(
ss
);
}
/** Return which port was reserved by createServerSocket(0).
* If the return value was 0, createServerSocket(0) wasn't called.
*/
public
int
whichPort
()
{
return
(
servport
);
}
}
// end class HttpOutFactory
}
test/sun/rmi/transport/tcp/DisableRMIOverHttp/TestIface.java
0 → 100644
浏览文件 @
8af1c11d
/*
* Copyright (c) 1999, 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.
*/
import
java.rmi.*
;
public
interface
TestIface
extends
Remote
{
public
String
testCall
(
String
ign
)
throws
RemoteException
;
}
test/sun/rmi/transport/tcp/DisableRMIOverHttp/TestImpl.java
0 → 100644
浏览文件 @
8af1c11d
/*
* Copyright (c) 1999, 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.
*/
import
java.rmi.*
;
import
java.rmi.server.*
;
public
class
TestImpl
extends
Object
implements
TestIface
{
public
TestImpl
()
{
}
public
TestIface
export
()
throws
RemoteException
{
return
(
TestIface
)
UnicastRemoteObject
.
exportObject
(
this
,
0
);
}
public
void
unexport
()
throws
NoSuchObjectException
{
UnicastRemoteObject
.
unexportObject
(
this
,
true
);
}
public
String
testCall
(
String
ign
)
{
return
(
"OK"
);
}
}
test/sun/rmi/transport/tcp/blockAccept/BlockAcceptTest.java
浏览文件 @
8af1c11d
...
...
@@ -29,7 +29,7 @@
*
* @library ../../../../../java/rmi/testlibrary
* @build TestIface TestImpl TestImpl_Stub
* @run main/othervm/policy=security.policy/timeout=60 BlockAcceptTest
* @run main/othervm/policy=security.policy/timeout=60
-Djava.rmi.server.disableIncomingHttp=false
BlockAcceptTest
*/
/* This test attempts to stymie the RMI accept loop. The accept loop in
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录