YARN-1914. Fixed resource-download on NodeManagers to skip permission verification of public cache files in Windows+local file-system environment. Contribued by Varun Vasudev.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1586434 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d14976020e
commit
cde7b17566
@ -100,6 +100,10 @@ Release 2.4.1 - UNRELEASED
|
||||
YARN-1920. Fixed TestFileSystemApplicationHistoryStore failure on windows.
|
||||
(Vinod Kumar Vavilapalli via zjshen)
|
||||
|
||||
YARN-1914. Fixed resource-download on NodeManagers to skip permission
|
||||
verification of public cache files in Windows+local file-system environment.
|
||||
(Varun Vasudev via vinodkv)
|
||||
|
||||
Release 2.4.0 - 2014-04-07
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -36,12 +36,14 @@
|
||||
import org.apache.hadoop.fs.FileStatus;
|
||||
import org.apache.hadoop.fs.FileSystem;
|
||||
import org.apache.hadoop.fs.FileUtil;
|
||||
import org.apache.hadoop.fs.LocalFileSystem;
|
||||
import org.apache.hadoop.fs.Options.Rename;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.hadoop.fs.permission.FsAction;
|
||||
import org.apache.hadoop.fs.permission.FsPermission;
|
||||
import org.apache.hadoop.security.UserGroupInformation;
|
||||
import org.apache.hadoop.util.RunJar;
|
||||
import org.apache.hadoop.util.Shell;
|
||||
import org.apache.hadoop.yarn.api.records.LocalResource;
|
||||
import org.apache.hadoop.yarn.api.records.LocalResourceVisibility;
|
||||
|
||||
@ -139,6 +141,16 @@ static boolean isPublic(FileSystem fs, Path current, FileStatus sStat,
|
||||
if (!checkPublicPermsForAll(fs, sStat, FsAction.READ_EXECUTE, FsAction.READ)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Shell.WINDOWS && fs instanceof LocalFileSystem) {
|
||||
// Relax the requirement for public cache on LFS on Windows since default
|
||||
// permissions are "700" all the way up to the drive letter. In this
|
||||
// model, the only requirement for a user is to give EVERYONE group
|
||||
// permission on the file and the file will be considered public.
|
||||
// This code path is only hit when fs.default.name is file:/// (mainly
|
||||
// in tests).
|
||||
return true;
|
||||
}
|
||||
return ancestorsHaveExecutePermissions(fs, current.getParent(), statCache);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user