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
3 changes: 3 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 @@ -582,6 +582,9 @@ private Path getScratchDir(String scheme, String authority,
throw new RuntimeException("Cannot make directory: "
+ dirPath.toString());
}
if (!fsPermission.equals(fsPermission.applyUMask(FsPermission.getUMask(conf)))) {
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,9 @@ private QueryResultsCache(HiveConf configuration) throws IOException {
FsPermission fsPermission = new FsPermission("700");
fs.mkdirs(cacheDirPath, fsPermission);

if (!fsPermission.equals(fsPermission.applyUMask(FsPermission.getUMask(conf)))) {
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,9 @@ 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 (!fsPermission.equals(fsPermission.applyUMask(FsPermission.getUMask(conf)))) {
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
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,9 @@ static void createPath(HiveConf conf, Path path, String permission, boolean isLo
if (!fs.mkdirs(path, fsPermission)) {
throw new IOException("Failed to create directory " + path + " on fs " + fs.getUri());
}
if (!fsPermission.equals(fsPermission.applyUMask(FsPermission.getUMask(conf)))) {
fs.setPermission(path, fsPermission);
}
String dirType = isLocal ? "local" : "HDFS";
LOG.info("Created " + dirType + " directory: " + path.toString());
}
Expand Down