Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
877a0227
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看板
提交
877a0227
编写于
8月 25, 2017
作者:
D
dbuck
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8074812: More specific error message when the .java_pid well-known file is not secure
Reviewed-by: jbachorik, martin
上级
4872c953
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
100 addition
and
36 deletion
+100
-36
src/aix/native/sun/tools/attach/AixVirtualMachine.c
src/aix/native/sun/tools/attach/AixVirtualMachine.c
+25
-9
src/solaris/native/sun/tools/attach/BsdVirtualMachine.c
src/solaris/native/sun/tools/attach/BsdVirtualMachine.c
+25
-9
src/solaris/native/sun/tools/attach/LinuxVirtualMachine.c
src/solaris/native/sun/tools/attach/LinuxVirtualMachine.c
+25
-9
src/solaris/native/sun/tools/attach/SolarisVirtualMachine.c
src/solaris/native/sun/tools/attach/SolarisVirtualMachine.c
+25
-9
未找到文件。
src/aix/native/sun/tools/attach/AixVirtualMachine.c
浏览文件 @
877a0227
/*
* Copyright (c) 2008, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 201
7
, Oracle and/or its affiliates. All rights reserved.
* Copyright 2015 SAP AG. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
...
...
@@ -26,6 +26,7 @@
#include "jni.h"
#include "jni_util.h"
#include "jvm.h"
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -184,15 +185,26 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_checkPermissions
res
=
errno
;
}
/* release p here before we throw an I/O exception */
if
(
isCopy
)
{
JNU_ReleaseStringPlatformChars
(
env
,
path
,
p
);
}
if
(
res
==
0
)
{
if
(
(
sb
.
st_uid
!=
uid
)
||
(
sb
.
st_gid
!=
gid
)
||
((
sb
.
st_mode
&
(
S_IRGRP
|
S_IWGRP
|
S_IROTH
|
S_IWOTH
))
!=
0
)
)
{
JNU_ThrowIOException
(
env
,
"well-known file is not secure"
);
char
msg
[
100
];
jboolean
isError
=
JNI_FALSE
;
if
(
sb
.
st_uid
!=
uid
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file should be owned by the current user (which is %d) but is owned by %d"
,
uid
,
sb
.
st_uid
);
isError
=
JNI_TRUE
;
}
else
if
(
sb
.
st_gid
!=
gid
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file's group should be the current group (which is %d) but the group is %d"
,
gid
,
sb
.
st_gid
);
isError
=
JNI_TRUE
;
}
else
if
((
sb
.
st_mode
&
(
S_IRGRP
|
S_IWGRP
|
S_IROTH
|
S_IWOTH
))
!=
0
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file should only be readable and writable by the owner but has 0%03o access"
,
sb
.
st_mode
&
0777
);
isError
=
JNI_TRUE
;
}
if
(
isError
)
{
char
buf
[
256
];
jio_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"well-known file %s is not secure: %s"
,
p
,
msg
);
JNU_ThrowIOException
(
env
,
buf
);
}
}
else
{
char
*
msg
=
strdup
(
strerror
(
res
));
...
...
@@ -201,6 +213,10 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_AixVirtualMachine_checkPermissions
free
(
msg
);
}
}
if
(
isCopy
)
{
JNU_ReleaseStringPlatformChars
(
env
,
path
,
p
);
}
}
}
...
...
src/solaris/native/sun/tools/attach/BsdVirtualMachine.c
浏览文件 @
877a0227
/*
* Copyright (c) 2005, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
7
, 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
...
...
@@ -25,6 +25,7 @@
#include "jni.h"
#include "jni_util.h"
#include "jvm.h"
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -149,15 +150,26 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_BsdVirtualMachine_checkPermissions
res
=
errno
;
}
/* release p here before we throw an I/O exception */
if
(
isCopy
)
{
JNU_ReleaseStringPlatformChars
(
env
,
path
,
p
);
}
if
(
res
==
0
)
{
if
(
(
sb
.
st_uid
!=
uid
)
||
(
sb
.
st_gid
!=
gid
)
||
((
sb
.
st_mode
&
(
S_IRGRP
|
S_IWGRP
|
S_IROTH
|
S_IWOTH
))
!=
0
)
)
{
JNU_ThrowIOException
(
env
,
"well-known file is not secure"
);
char
msg
[
100
];
jboolean
isError
=
JNI_FALSE
;
if
(
sb
.
st_uid
!=
uid
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file should be owned by the current user (which is %d) but is owned by %d"
,
uid
,
sb
.
st_uid
);
isError
=
JNI_TRUE
;
}
else
if
(
sb
.
st_gid
!=
gid
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file's group should be the current group (which is %d) but the group is %d"
,
gid
,
sb
.
st_gid
);
isError
=
JNI_TRUE
;
}
else
if
((
sb
.
st_mode
&
(
S_IRGRP
|
S_IWGRP
|
S_IROTH
|
S_IWOTH
))
!=
0
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file should only be readable and writable by the owner but has 0%03o access"
,
sb
.
st_mode
&
0777
);
isError
=
JNI_TRUE
;
}
if
(
isError
)
{
char
buf
[
256
];
jio_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"well-known file %s is not secure: %s"
,
p
,
msg
);
JNU_ThrowIOException
(
env
,
buf
);
}
}
else
{
char
*
msg
=
strdup
(
strerror
(
res
));
...
...
@@ -166,6 +178,10 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_BsdVirtualMachine_checkPermissions
free
(
msg
);
}
}
if
(
isCopy
)
{
JNU_ReleaseStringPlatformChars
(
env
,
path
,
p
);
}
}
}
...
...
src/solaris/native/sun/tools/attach/LinuxVirtualMachine.c
浏览文件 @
877a0227
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005,
2017,
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
...
...
@@ -25,6 +25,7 @@
#include "jni.h"
#include "jni_util.h"
#include "jvm.h"
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -367,15 +368,26 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_LinuxVirtualMachine_checkPermission
res
=
errno
;
}
/* release p here before we throw an I/O exception */
if
(
isCopy
)
{
JNU_ReleaseStringPlatformChars
(
env
,
path
,
p
);
}
if
(
res
==
0
)
{
if
(
(
sb
.
st_uid
!=
uid
)
||
(
sb
.
st_gid
!=
gid
)
||
((
sb
.
st_mode
&
(
S_IRGRP
|
S_IWGRP
|
S_IROTH
|
S_IWOTH
))
!=
0
)
)
{
JNU_ThrowIOException
(
env
,
"well-known file is not secure"
);
char
msg
[
100
];
jboolean
isError
=
JNI_FALSE
;
if
(
sb
.
st_uid
!=
uid
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file should be owned by the current user (which is %d) but is owned by %d"
,
uid
,
sb
.
st_uid
);
isError
=
JNI_TRUE
;
}
else
if
(
sb
.
st_gid
!=
gid
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file's group should be the current group (which is %d) but the group is %d"
,
gid
,
sb
.
st_gid
);
isError
=
JNI_TRUE
;
}
else
if
((
sb
.
st_mode
&
(
S_IRGRP
|
S_IWGRP
|
S_IROTH
|
S_IWOTH
))
!=
0
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file should only be readable and writable by the owner but has 0%03o access"
,
sb
.
st_mode
&
0777
);
isError
=
JNI_TRUE
;
}
if
(
isError
)
{
char
buf
[
256
];
jio_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"well-known file %s is not secure: %s"
,
p
,
msg
);
JNU_ThrowIOException
(
env
,
buf
);
}
}
else
{
char
*
msg
=
strdup
(
strerror
(
res
));
...
...
@@ -384,6 +396,10 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_LinuxVirtualMachine_checkPermission
free
(
msg
);
}
}
if
(
isCopy
)
{
JNU_ReleaseStringPlatformChars
(
env
,
path
,
p
);
}
}
}
...
...
src/solaris/native/sun/tools/attach/SolarisVirtualMachine.c
浏览文件 @
877a0227
/*
* Copyright (c) 2005, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
7
, 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
...
...
@@ -35,6 +35,7 @@
#include "jni.h"
#include "jni_util.h"
#include "jvm.h"
#include "sun_tools_attach_SolarisVirtualMachine.h"
...
...
@@ -112,15 +113,26 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_SolarisVirtualMachine_checkPermissi
res
=
errno
;
}
/* release p here before we throw an I/O exception */
if
(
isCopy
)
{
JNU_ReleaseStringPlatformChars
(
env
,
path
,
p
);
}
if
(
res
==
0
)
{
if
(
(
sb
.
st_uid
!=
uid
)
||
(
sb
.
st_gid
!=
gid
)
||
((
sb
.
st_mode
&
(
S_IRGRP
|
S_IWGRP
|
S_IROTH
|
S_IWOTH
))
!=
0
)
)
{
JNU_ThrowIOException
(
env
,
"well-known file is not secure"
);
char
msg
[
100
];
jboolean
isError
=
JNI_FALSE
;
if
(
sb
.
st_uid
!=
uid
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file should be owned by the current user (which is %d) but is owned by %d"
,
uid
,
sb
.
st_uid
);
isError
=
JNI_TRUE
;
}
else
if
(
sb
.
st_gid
!=
gid
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file's group should be the current group (which is %d) but the group is %d"
,
gid
,
sb
.
st_gid
);
isError
=
JNI_TRUE
;
}
else
if
((
sb
.
st_mode
&
(
S_IRGRP
|
S_IWGRP
|
S_IROTH
|
S_IWOTH
))
!=
0
)
{
jio_snprintf
(
msg
,
sizeof
(
msg
)
-
1
,
"file should only be readable and writable by the owner but has 0%03o access"
,
sb
.
st_mode
&
0777
);
isError
=
JNI_TRUE
;
}
if
(
isError
)
{
char
buf
[
256
];
jio_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"well-known file %s is not secure: %s"
,
p
,
msg
);
JNU_ThrowIOException
(
env
,
buf
);
}
}
else
{
char
*
msg
=
strdup
(
strerror
(
res
));
...
...
@@ -129,6 +141,10 @@ JNIEXPORT void JNICALL Java_sun_tools_attach_SolarisVirtualMachine_checkPermissi
free
(
msg
);
}
}
if
(
isCopy
)
{
JNU_ReleaseStringPlatformChars
(
env
,
path
,
p
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录