src/os/solaris/vm/perfMemory_solaris.cpp

Print this page

        

@@ -217,13 +217,13 @@
     // The directory is open for writing and could be subjected
     // to a symlink or a hard link attack. Declare it insecure.
     //
     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;
   }
   return true;