Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
0e27d842
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0e27d842
编写于
11月 04, 2015
作者:
C
clanger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8140244: Port fix of JDK-8075773 to AIX and possibly MacOSX
Reviewed-by: stuefe, dcubed
上级
5e87dde8
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
11 addition
and
6 deletion
+11
-6
src/os/aix/vm/perfMemory_aix.cpp
src/os/aix/vm/perfMemory_aix.cpp
+8
-3
src/os/bsd/vm/perfMemory_bsd.cpp
src/os/bsd/vm/perfMemory_bsd.cpp
+3
-3
未找到文件。
src/os/aix/vm/perfMemory_aix.cpp
浏览文件 @
0e27d842
...
...
@@ -201,6 +201,7 @@ static pid_t filename_to_pid(const char* filename) {
// the backing store files. Returns true if the directory is considered
// a secure location. Returns false if the statbuf is a symbolic link or
// if an error occurred.
//
static
bool
is_statbuf_secure
(
struct
stat
*
statp
)
{
if
(
S_ISLNK
(
statp
->
st_mode
)
||
!
S_ISDIR
(
statp
->
st_mode
))
{
// The path represents a link or some non-directory file type,
...
...
@@ -209,15 +210,18 @@ static bool is_statbuf_secure(struct stat *statp) {
return
false
;
}
// We have an existing directory, check if the permissions are safe.
//
if
((
statp
->
st_mode
&
(
S_IWGRP
|
S_IWOTH
))
!=
0
)
{
// The directory is open for writing and could be subjected
// to a symlink or a hard link attack. Declare it insecure.
//
return
false
;
}
//
S
ee if the uid of the directory matches the effective uid of the process.
//
if
(
statp
->
st_uid
!=
geteuid
(
))
{
//
If user is not root then s
ee if the uid of the directory matches the effective uid of the process.
uid_t
euid
=
geteuid
();
if
(
(
euid
!=
0
)
&&
(
statp
->
st_uid
!=
euid
))
{
// The directory was not created by this user, declare it insecure.
//
return
false
;
}
return
true
;
...
...
@@ -228,6 +232,7 @@ static bool is_statbuf_secure(struct stat *statp) {
// the backing store files. Returns true if the directory exists
// and is considered a secure location. Returns false if the path
// is a symbolic link or if an error occurred.
//
static
bool
is_directory_secure
(
const
char
*
path
)
{
struct
stat
statbuf
;
int
result
=
0
;
...
...
src/os/bsd/vm/perfMemory_bsd.cpp
浏览文件 @
0e27d842
...
...
@@ -217,9 +217,9 @@ static bool is_statbuf_secure(struct stat *statp) {
//
return
false
;
}
//
S
ee if the uid of the directory matches the effective uid of the process.
//
if
(
statp
->
st_uid
!=
geteuid
(
))
{
//
If user is not root then s
ee if the uid of the directory matches the effective uid of the process.
uid_t
euid
=
geteuid
();
if
(
(
euid
!=
0
)
&&
(
statp
->
st_uid
!=
euid
))
{
// The directory was not created by this user, declare it insecure.
//
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录