8075773: jps running as root fails after the fix of JDK-8050807
Reviewed-by: sla, dsamersoff, gthornbr
This commit is contained in:
parent
47dd02d847
commit
95fb9da9de
@ -217,9 +217,9 @@ static bool is_statbuf_secure(struct stat *statp) {
|
|||||||
//
|
//
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// See if the uid of the directory matches the effective uid of the process.
|
// If user is not root then see if the uid of the directory matches the effective uid of the process.
|
||||||
//
|
uid_t euid = geteuid();
|
||||||
if (statp->st_uid != geteuid()) {
|
if ((euid != 0) && (statp->st_uid != euid)) {
|
||||||
// The directory was not created by this user, declare it insecure.
|
// The directory was not created by this user, declare it insecure.
|
||||||
//
|
//
|
||||||
return false;
|
return false;
|
||||||
|
@ -219,9 +219,9 @@ static bool is_statbuf_secure(struct stat *statp) {
|
|||||||
//
|
//
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// See if the uid of the directory matches the effective uid of the process.
|
// If user is not root then see if the uid of the directory matches the effective uid of the process.
|
||||||
//
|
uid_t euid = geteuid();
|
||||||
if (statp->st_uid != geteuid()) {
|
if ((euid != 0) && (statp->st_uid != euid)) {
|
||||||
// The directory was not created by this user, declare it insecure.
|
// The directory was not created by this user, declare it insecure.
|
||||||
//
|
//
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user