Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
702614ef
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看板
提交
702614ef
编写于
8月 16, 2016
作者:
S
shshahma
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8158406: Limited Parameter Processing
Reviewed-by: dfuchs, skoivu
上级
d5f6c573
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
22 deletion
+45
-22
src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java
...lasses/javax/management/remote/rmi/RMIConnectionImpl.java
+45
-22
未找到文件。
src/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java
浏览文件 @
702614ef
...
...
@@ -349,7 +349,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
+
", unwrapping parameters using classLoaderWithRepository."
);
values
=
nullIsEmpty
(
unwrap
(
params
,
classLoaderWithRepository
,
Object
[].
class
));
nullIsEmpty
(
unwrap
(
params
,
classLoaderWithRepository
,
Object
[].
class
,
delegationSubject
));
try
{
final
Object
params2
[]
=
...
...
@@ -413,7 +413,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
values
=
nullIsEmpty
(
unwrap
(
params
,
getClassLoader
(
loaderName
),
defaultClassLoader
,
Object
[].
class
));
Object
[].
class
,
delegationSubject
));
try
{
final
Object
params2
[]
=
...
...
@@ -524,7 +524,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
"connectionId="
+
connectionId
+
" unwrapping query with defaultClassLoader."
);
queryValue
=
unwrap
(
query
,
defaultContextClassLoader
,
QueryExp
.
class
);
queryValue
=
unwrap
(
query
,
defaultContextClassLoader
,
QueryExp
.
class
,
delegationSubject
);
try
{
final
Object
params
[]
=
new
Object
[]
{
name
,
queryValue
};
...
...
@@ -559,7 +559,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
"connectionId="
+
connectionId
+
" unwrapping query with defaultClassLoader."
);
queryValue
=
unwrap
(
query
,
defaultContextClassLoader
,
QueryExp
.
class
);
queryValue
=
unwrap
(
query
,
defaultContextClassLoader
,
QueryExp
.
class
,
delegationSubject
);
try
{
final
Object
params
[]
=
new
Object
[]
{
name
,
queryValue
};
...
...
@@ -709,7 +709,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
attr
=
unwrap
(
attribute
,
getClassLoaderFor
(
name
),
defaultClassLoader
,
Attribute
.
class
);
Attribute
.
class
,
delegationSubject
);
try
{
final
Object
params
[]
=
new
Object
[]
{
name
,
attr
};
...
...
@@ -760,7 +760,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
unwrap
(
attributes
,
getClassLoaderFor
(
name
),
defaultClassLoader
,
AttributeList
.
class
);
AttributeList
.
class
,
delegationSubject
);
try
{
final
Object
params
[]
=
new
Object
[]
{
name
,
attrlist
};
...
...
@@ -812,7 +812,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
values
=
nullIsEmpty
(
unwrap
(
params
,
getClassLoaderFor
(
name
),
defaultClassLoader
,
Object
[].
class
));
Object
[].
class
,
delegationSubject
));
try
{
final
Object
params2
[]
=
...
...
@@ -992,7 +992,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
filterValues
[
i
]
=
unwrap
(
filters
[
i
],
targetCl
,
defaultClassLoader
,
NotificationFilter
.
class
);
NotificationFilter
.
class
,
delegationSubjects
[
i
]
);
if
(
debug
)
logger
.
debug
(
"addNotificationListener"
+
"(ObjectName,NotificationFilter)"
,
...
...
@@ -1060,7 +1060,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
+
" unwrapping filter with target extended ClassLoader."
);
filterValue
=
unwrap
(
filter
,
targetCl
,
defaultClassLoader
,
NotificationFilter
.
class
);
unwrap
(
filter
,
targetCl
,
defaultClassLoader
,
NotificationFilter
.
class
,
delegationSubject
);
if
(
debug
)
logger
.
debug
(
"addNotificationListener"
+
"(ObjectName,ObjectName,NotificationFilter,Object)"
,
...
...
@@ -1068,7 +1068,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
+
" unwrapping handback with target extended ClassLoader."
);
handbackValue
=
unwrap
(
handback
,
targetCl
,
defaultClassLoader
,
Object
.
class
);
unwrap
(
handback
,
targetCl
,
defaultClassLoader
,
Object
.
class
,
delegationSubject
);
try
{
final
Object
params
[]
=
...
...
@@ -1199,7 +1199,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
+
" unwrapping filter with target extended ClassLoader."
);
filterValue
=
unwrap
(
filter
,
targetCl
,
defaultClassLoader
,
NotificationFilter
.
class
);
unwrap
(
filter
,
targetCl
,
defaultClassLoader
,
NotificationFilter
.
class
,
delegationSubject
);
if
(
debug
)
logger
.
debug
(
"removeNotificationListener"
+
"(ObjectName,ObjectName,NotificationFilter,Object)"
,
...
...
@@ -1207,7 +1207,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
+
" unwrapping handback with target extended ClassLoader."
);
handbackValue
=
unwrap
(
handback
,
targetCl
,
defaultClassLoader
,
Object
.
class
);
unwrap
(
handback
,
targetCl
,
defaultClassLoader
,
Object
.
class
,
delegationSubject
);
try
{
final
Object
params
[]
=
...
...
@@ -1551,20 +1551,38 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
}
}
private
static
<
T
>
T
unwrap
(
final
MarshalledObject
<?>
mo
,
private
<
T
>
T
unwrap
(
final
MarshalledObject
<?>
mo
,
final
ClassLoader
cl
,
final
Class
<
T
>
wrappedClass
)
final
Class
<
T
>
wrappedClass
,
Subject
delegationSubject
)
throws
IOException
{
if
(
mo
==
null
)
{
return
null
;
}
try
{
final
ClassLoader
old
=
AccessController
.
doPrivileged
(
new
SetCcl
(
cl
));
try
{
return
wrappedClass
.
cast
(
mo
.
get
());
}
catch
(
ClassNotFoundException
cnfe
)
{
throw
new
UnmarshalException
(
cnfe
.
toString
(),
cnfe
);
}
finally
{
try
{
final
AccessControlContext
reqACC
;
if
(
delegationSubject
==
null
)
reqACC
=
acc
;
else
{
if
(
subject
==
null
)
{
final
String
msg
=
"Subject delegation cannot be enabled unless "
+
"an authenticated subject is put in place"
;
throw
new
SecurityException
(
msg
);
}
reqACC
=
subjectDelegator
.
delegatedContext
(
acc
,
delegationSubject
,
removeCallerContext
);
}
if
(
reqACC
!=
null
){
return
AccessController
.
doPrivileged
(
(
PrivilegedExceptionAction
<
T
>)
()
->
wrappedClass
.
cast
(
mo
.
get
()),
reqACC
);
}
else
{
return
wrappedClass
.
cast
(
mo
.
get
());
}
}
finally
{
AccessController
.
doPrivileged
(
new
SetCcl
(
old
));
}
}
catch
(
PrivilegedActionException
pe
)
{
...
...
@@ -1577,14 +1595,19 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
}
logger
.
warning
(
"unwrap"
,
"Failed to unmarshall object: "
+
e
);
logger
.
debug
(
"unwrap"
,
e
);
}
catch
(
ClassNotFoundException
ex
)
{
logger
.
warning
(
"unwrap"
,
"Failed to unmarshall object: "
+
ex
);
logger
.
debug
(
"unwrap"
,
ex
);
throw
new
UnmarshalException
(
ex
.
toString
(),
ex
);
}
return
null
;
}
private
static
<
T
>
T
unwrap
(
final
MarshalledObject
<?>
mo
,
private
<
T
>
T
unwrap
(
final
MarshalledObject
<?>
mo
,
final
ClassLoader
cl1
,
final
ClassLoader
cl2
,
final
Class
<
T
>
wrappedClass
)
final
Class
<
T
>
wrappedClass
,
Subject
delegationSubject
)
throws
IOException
{
if
(
mo
==
null
)
{
return
null
;
...
...
@@ -1598,7 +1621,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
}
}
);
return
unwrap
(
mo
,
orderCL
,
wrappedClass
);
return
unwrap
(
mo
,
orderCL
,
wrappedClass
,
delegationSubject
);
}
catch
(
PrivilegedActionException
pe
)
{
Exception
e
=
extractException
(
pe
);
if
(
e
instanceof
IOException
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录