# HG changeset patch # User kevinw # Date 1438844937 25200 # Node ID 9bf9a733246b5e89986233f42a8e00c798ca703f # Parent 227efd9e46467c723bf22d0720932df883db51f4 8075773: jps running as root fails after the fix of JDK-8050807 Reviewed-by: sla, dsamersoff, gthornbr Contributed-by: cheleswer.sahu@oracle.com diff -r 227efd9e4646 -r 9bf9a733246b src/os/linux/vm/perfMemory_linux.cpp --- a/src/os/linux/vm/perfMemory_linux.cpp Wed Sep 16 15:31:47 2015 +0300 +++ b/src/os/linux/vm/perfMemory_linux.cpp Thu Aug 06 00:08:57 2015 -0700 @@ -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; diff -r 227efd9e4646 -r 9bf9a733246b src/os/solaris/vm/perfMemory_solaris.cpp --- a/src/os/solaris/vm/perfMemory_solaris.cpp Wed Sep 16 15:31:47 2015 +0300 +++ b/src/os/solaris/vm/perfMemory_solaris.cpp Thu Aug 06 00:08:57 2015 -0700 @@ -219,9 +219,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;