8075773: jps running as root fails after the fix of JDK-8050807

Reviewed-by: sla, dsamersoff, gthornbr
This commit is contained in:
Cheleswer Sahu 2015-08-06 00:08:57 -07:00 committed by Kevin Walls
parent 47dd02d847
commit 95fb9da9de
2 changed files with 6 additions and 6 deletions

View File

@ -217,9 +217,9 @@ static bool is_statbuf_secure(struct stat *statp) {
//
return false;
}
// See if the uid of the directory matches the effective uid of the process.
//
if (statp->st_uid != geteuid()) {
// 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 ((euid != 0) && (statp->st_uid != euid)) {
// The directory was not created by this user, declare it insecure.
//
return false;

View File

@ -219,9 +219,9 @@ static bool is_statbuf_secure(struct stat *statp) {
//
return false;
}
// See if the uid of the directory matches the effective uid of the process.
//
if (statp->st_uid != geteuid()) {
// 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 ((euid != 0) && (statp->st_uid != euid)) {
// The directory was not created by this user, declare it insecure.
//
return false;