8140244: Port fix of JDK-8075773 to AIX and possibly MacOSX

Reviewed-by: stuefe, dcubed
This commit is contained in:
Christoph Langer 2015-11-04 16:23:08 -08:00
parent 63f370152d
commit b6230a727d
2 changed files with 11 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;