comparison src/os/linux/vm/perfMemory_linux.cpp @ 23416:decf7079a7b9

8075773: jps running as root fails after the fix of JDK-8050807 Reviewed-by: sla, dsamersoff, gthornbr Contributed-by: cheleswer.sahu@oracle.com
author kevinw
date Thu, 06 Aug 2015 00:08:57 -0700
parents f3ffb37f88a6
children 9f8038f83a6e
comparison
equal deleted inserted replaced
23414:b2ca5aba9449 23416:decf7079a7b9
215 // The directory is open for writing and could be subjected 215 // The directory is open for writing and could be subjected
216 // to a symlink or a hard link attack. Declare it insecure. 216 // to a symlink or a hard link attack. Declare it insecure.
217 // 217 //
218 return false; 218 return false;
219 } 219 }
220 // See if the uid of the directory matches the effective uid of the process. 220 // If user is not root then see if the uid of the directory matches the effective uid of the process.
221 // 221 uid_t euid = geteuid();
222 if (statp->st_uid != geteuid()) { 222 if ((euid != 0) && (statp->st_uid != euid)) {
223 // The directory was not created by this user, declare it insecure. 223 // The directory was not created by this user, declare it insecure.
224 // 224 //
225 return false; 225 return false;
226 } 226 }
227 return true; 227 return true;