YARN-7879. NM user is unable to access the application filecache due to permissions. Contributed by Jason Lowe.
This commit is contained in:
parent
0ef639235b
commit
c7101fe21b
|
@ -401,7 +401,7 @@ public class FSDownload implements Callable<Path> {
|
||||||
}
|
}
|
||||||
|
|
||||||
final Path destinationTmp = new Path(destDirPath + "_tmp");
|
final Path destinationTmp = new Path(destDirPath + "_tmp");
|
||||||
createDir(destinationTmp, PRIVATE_DIR_PERMS);
|
createDir(destinationTmp, cachePerms);
|
||||||
Path dFinal =
|
Path dFinal =
|
||||||
files.makeQualified(new Path(destinationTmp, sCopy.getName()));
|
files.makeQualified(new Path(destinationTmp, sCopy.getName()));
|
||||||
try {
|
try {
|
||||||
|
@ -416,10 +416,7 @@ public class FSDownload implements Callable<Path> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Path destinationTmpfilesQualified = files.makeQualified(destinationTmp);
|
changePermissions(dFinal.getFileSystem(conf), dFinal);
|
||||||
changePermissions(
|
|
||||||
destinationTmpfilesQualified.getFileSystem(conf),
|
|
||||||
destinationTmpfilesQualified);
|
|
||||||
files.rename(destinationTmp, destDirPath, Rename.OVERWRITE);
|
files.rename(destinationTmp, destDirPath, Rename.OVERWRITE);
|
||||||
|
|
||||||
if (LOG.isDebugEnabled()) {
|
if (LOG.isDebugEnabled()) {
|
||||||
|
|
|
@ -451,7 +451,7 @@ public class TestFSDownload {
|
||||||
FileStatus status = files.getFileStatus(localized.getParent());
|
FileStatus status = files.getFileStatus(localized.getParent());
|
||||||
FsPermission perm = status.getPermission();
|
FsPermission perm = status.getPermission();
|
||||||
assertEquals("Cache directory permissions are incorrect",
|
assertEquals("Cache directory permissions are incorrect",
|
||||||
new FsPermission((short)0700), perm);
|
new FsPermission((short)0755), perm);
|
||||||
|
|
||||||
status = files.getFileStatus(localized);
|
status = files.getFileStatus(localized);
|
||||||
perm = status.getPermission();
|
perm = status.getPermission();
|
||||||
|
|
Loading…
Reference in New Issue