hotspot/src/os/bsd/vm/perfMemory_bsd.cpp
changeset 33769 d04b4e2165a7
parent 32387 a376fff9d4a5
child 37113 5a33bf5089ac
--- a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp	Wed Nov 04 20:02:54 2015 +0000
+++ b/hotspot/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;