src/os/linux/vm/perfMemory_linux.cpp

Print this page

        

*** 215,227 **** // 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()) { // The directory was not created by this user, declare it insecure. // return false; } return true; --- 215,227 ---- // The directory is open for writing and could be subjected // to a symlink or a hard link attack. Declare it insecure. // return false; } ! //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;