Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ql/src/java/org/apache/hadoop/hive/ql/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,11 @@ private Path getScratchDir(String scheme, String authority,
throw new RuntimeException("Cannot make directory: "
+ dirPath.toString());
}
if (!fs.getFileStatus(dirPath).getPermission().equals(fsPermission)) {
LOG.warn("Directory {} created with unexpected permissions : {}.Change permission to : ",
dirPath, fs.getFileStatus(dirPath).getPermission(), fsPermission);
fs.setPermission(dirPath, fsPermission);
}
if (isHDFSCleanup) {
fs.deleteOnExit(dirPath);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ private QueryResultsCache(HiveConf configuration) throws IOException {
FsPermission fsPermission = new FsPermission("700");
fs.mkdirs(cacheDirPath, fsPermission);

if (!fs.getFileStatus(cacheDirPath).getPermission().equals(fsPermission)) {
LOG.warn("Directory {} created with unexpected permissions : {}.Change permission to : ",
cacheDirPath, fs.getFileStatus(cacheDirPath).getPermission(), fsPermission);
fs.setPermission(cacheDirPath, fsPermission);
}
// Create non-existent path for 0-row results
zeroRowsPath = new Path(cacheDirPath, "dummy_zero_rows");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,11 @@ private Path createTezDir(String sessionId, String suffix) throws IOException {
FileSystem fs = tezDir.getFileSystem(conf);
FsPermission fsPermission = new FsPermission(HiveConf.getVar(conf, HiveConf.ConfVars.SCRATCHDIRPERMISSION));
fs.mkdirs(tezDir, fsPermission);
if(!fs.getFileStatus(tezDir).getPermission().equals(fsPermission)){
LOG.warn("Directory {} created with unexpected permissions : {}.Change permission to : ",
tezDir, fs.getFileStatus(tezDir).getPermission(), fsPermission);
fs.setPermission(tezDir, fsPermission);
}
// Make sure the path is normalized (we expect validation to pass since we just created it).
tezDir = DagUtils.validateTargetDir(tezDir, conf).getPath();

Expand Down