Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
7b0d3938
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看板
提交
7b0d3938
编写于
11月 23, 2009
作者:
M
mchung
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
afbd4917
054f67b8
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
35 addition
and
28 deletion
+35
-28
src/share/classes/javax/security/auth/Subject.java
src/share/classes/javax/security/auth/Subject.java
+35
-19
src/share/classes/sun/security/util/SecurityConstants.java
src/share/classes/sun/security/util/SecurityConstants.java
+0
-9
未找到文件。
src/share/classes/javax/security/auth/Subject.java
浏览文件 @
7b0d3938
...
...
@@ -40,7 +40,6 @@ import java.security.PrivilegedExceptionAction;
import
java.security.PrivilegedActionException
;
import
java.security.ProtectionDomain
;
import
sun.security.util.ResourcesMgr
;
import
sun.security.util.SecurityConstants
;
/**
* <p> A <code>Subject</code> represents a grouping of related information
...
...
@@ -239,7 +238,7 @@ public final class Subject implements java.io.Serializable {
public
void
setReadOnly
()
{
java
.
lang
.
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
sm
.
checkPermission
(
new
AuthPermission
(
"setReadOnly"
)
);
sm
.
checkPermission
(
AuthPermissionHolder
.
SET_READ_ONLY_PERMISSION
);
}
this
.
readOnly
=
true
;
...
...
@@ -285,7 +284,7 @@ public final class Subject implements java.io.Serializable {
java
.
lang
.
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
sm
.
checkPermission
(
new
AuthPermission
(
"getSubject"
)
);
sm
.
checkPermission
(
AuthPermissionHolder
.
GET_SUBJECT_PERMISSION
);
}
if
(
acc
==
null
)
{
...
...
@@ -343,7 +342,7 @@ public final class Subject implements java.io.Serializable {
java
.
lang
.
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
sm
.
checkPermission
(
SecurityConstants
.
DO_AS_PERMISSION
);
sm
.
checkPermission
(
AuthPermissionHolder
.
DO_AS_PERMISSION
);
}
if
(
action
==
null
)
throw
new
NullPointerException
...
...
@@ -402,7 +401,7 @@ public final class Subject implements java.io.Serializable {
java
.
lang
.
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
sm
.
checkPermission
(
SecurityConstants
.
DO_AS_PERMISSION
);
sm
.
checkPermission
(
AuthPermissionHolder
.
DO_AS_PERMISSION
);
}
if
(
action
==
null
)
...
...
@@ -456,7 +455,7 @@ public final class Subject implements java.io.Serializable {
java
.
lang
.
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
sm
.
checkPermission
(
SecurityConstants
.
DO_AS_PRIVILEGED_PERMISSION
);
sm
.
checkPermission
(
AuthPermissionHolder
.
DO_AS_PRIVILEGED_PERMISSION
);
}
if
(
action
==
null
)
...
...
@@ -520,7 +519,7 @@ public final class Subject implements java.io.Serializable {
java
.
lang
.
SecurityManager
sm
=
System
.
getSecurityManager
();
if
(
sm
!=
null
)
{
sm
.
checkPermission
(
SecurityConstants
.
DO_AS_PRIVILEGED_PERMISSION
);
sm
.
checkPermission
(
AuthPermissionHolder
.
DO_AS_PRIVILEGED_PERMISSION
);
}
if
(
action
==
null
)
...
...
@@ -1044,16 +1043,13 @@ public final class Subject implements java.io.Serializable {
if
(
sm
!=
null
)
{
switch
(
which
)
{
case
Subject
.
PRINCIPAL_SET
:
sm
.
checkPermission
(
new
AuthPermission
(
"modifyPrincipals"
));
sm
.
checkPermission
(
AuthPermissionHolder
.
MODIFY_PRINCIPALS_PERMISSION
);
break
;
case
Subject
.
PUB_CREDENTIAL_SET
:
sm
.
checkPermission
(
new
AuthPermission
(
"modifyPublicCredentials"
));
sm
.
checkPermission
(
AuthPermissionHolder
.
MODIFY_PUBLIC_CREDENTIALS_PERMISSION
);
break
;
default
:
sm
.
checkPermission
(
new
AuthPermission
(
"modifyPrivateCredentials"
));
sm
.
checkPermission
(
AuthPermissionHolder
.
MODIFY_PRIVATE_CREDENTIALS_PERMISSION
);
break
;
}
}
...
...
@@ -1073,16 +1069,13 @@ public final class Subject implements java.io.Serializable {
if
(
sm
!=
null
)
{
switch
(
which
)
{
case
Subject
.
PRINCIPAL_SET
:
sm
.
checkPermission
(
new
AuthPermission
(
"modifyPrincipals"
));
sm
.
checkPermission
(
AuthPermissionHolder
.
MODIFY_PRINCIPALS_PERMISSION
);
break
;
case
Subject
.
PUB_CREDENTIAL_SET
:
sm
.
checkPermission
(
new
AuthPermission
(
"modifyPublicCredentials"
));
sm
.
checkPermission
(
AuthPermissionHolder
.
MODIFY_PUBLIC_CREDENTIALS_PERMISSION
);
break
;
default
:
sm
.
checkPermission
(
new
AuthPermission
(
"modifyPrivateCredentials"
));
sm
.
checkPermission
(
AuthPermissionHolder
.
MODIFY_PRIVATE_CREDENTIALS_PERMISSION
);
break
;
}
}
...
...
@@ -1405,4 +1398,27 @@ public final class Subject implements java.io.Serializable {
return
set
.
add
(
o
);
}
}
static
class
AuthPermissionHolder
{
static
final
AuthPermission
DO_AS_PERMISSION
=
new
AuthPermission
(
"doAs"
);
static
final
AuthPermission
DO_AS_PRIVILEGED_PERMISSION
=
new
AuthPermission
(
"doAsPrivileged"
);
static
final
AuthPermission
SET_READ_ONLY_PERMISSION
=
new
AuthPermission
(
"setReadOnly"
);
static
final
AuthPermission
GET_SUBJECT_PERMISSION
=
new
AuthPermission
(
"getSubject"
);
static
final
AuthPermission
MODIFY_PRINCIPALS_PERMISSION
=
new
AuthPermission
(
"modifyPrincipals"
);
static
final
AuthPermission
MODIFY_PUBLIC_CREDENTIALS_PERMISSION
=
new
AuthPermission
(
"modifyPublicCredentials"
);
static
final
AuthPermission
MODIFY_PRIVATE_CREDENTIALS_PERMISSION
=
new
AuthPermission
(
"modifyPrivateCredentials"
);
}
}
src/share/classes/sun/security/util/SecurityConstants.java
浏览文件 @
7b0d3938
...
...
@@ -33,7 +33,6 @@ import java.security.Permission;
import
java.security.BasicPermission
;
import
java.security.SecurityPermission
;
import
java.security.AllPermission
;
import
javax.security.auth.AuthPermission
;
/**
* Permission constants and string constants used to create permissions
...
...
@@ -259,12 +258,4 @@ public final class SecurityConstants {
// java.lang.SecurityManager
public
static
final
SocketPermission
LOCAL_LISTEN_PERMISSION
=
new
SocketPermission
(
"localhost:1024-"
,
SOCKET_LISTEN_ACTION
);
// javax.security.auth.Subject
public
static
final
AuthPermission
DO_AS_PERMISSION
=
new
AuthPermission
(
"doAs"
);
// javax.security.auth.Subject
public
static
final
AuthPermission
DO_AS_PRIVILEGED_PERMISSION
=
new
AuthPermission
(
"doAsPrivileged"
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录