diff src/os/bsd/vm/perfMemory_bsd.cpp @ 23488:2d23269a45a0

8140244: Port fix of JDK-8075773 to AIX and possibly MacOSX Reviewed-by: stuefe, dcubed
author clanger
date Wed, 04 Nov 2015 16:23:08 -0800
parents 9f8038f83a6e
children
line wrap: on
line diff
--- a/src/os/bsd/vm/perfMemory_bsd.cpp	Thu Jan 07 02:36:48 2016 -0800
+++ b/src/os/bsd/vm/perfMemory_bsd.cpp	Wed Nov 04 16:23:08 2015 -0800
@@ -217,9 +217,9 @@
     //
     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;