Review Board 1.7.22


HIVE-4487 (Hive does not set explicit permissions on hive.exec.scratchdir)

Review Request #12049 - Created June 22, 2013 and updated

Chaoyu Tang
trunk
HIVE-4487
Reviewers
hive
hive-git
The changes include:
1. a new property hive.scratch.dir.permission with default value 700 to control the permission of dirs created directly under scratchdir (local and hdfs)
2. only the directories directly under hdfs /tmp/hive-{username} or local /tmp/{username} will be set to the permission as specified by above property. These include ones created for the mapred jobs. By doing so,  we will add the protection to newly created dirs/files with minimal code change, and also preserve the permissions of the existing scratchdirs (for back-compatibility).
Manual tests

Diff revision 2 (Latest)

1 2
1 2

  1. common/src/java/org/apache/hadoop/hive/conf/HiveConf.java: Loading...
  2. ql/src/java/org/apache/hadoop/hive/ql/Context.java: Loading...
common/src/java/org/apache/hadoop/hive/conf/HiveConf.java
Revision 73ec6f2 New Change
[20] 176 lines
[+20] [+] public class HiveConf extends Configuration {
177
    // QL execution stuff
177
    // QL execution stuff
178
    SCRIPTWRAPPER("hive.exec.script.wrapper", null),
178
    SCRIPTWRAPPER("hive.exec.script.wrapper", null),
179
    PLAN("hive.exec.plan", ""),
179
    PLAN("hive.exec.plan", ""),
180
    SCRATCHDIR("hive.exec.scratchdir", "/tmp/hive-" + System.getProperty("user.name")),
180
    SCRATCHDIR("hive.exec.scratchdir", "/tmp/hive-" + System.getProperty("user.name")),
181
    LOCALSCRATCHDIR("hive.exec.local.scratchdir", System.getProperty("java.io.tmpdir") + File.separator + System.getProperty("user.name")),
181
    LOCALSCRATCHDIR("hive.exec.local.scratchdir", System.getProperty("java.io.tmpdir") + File.separator + System.getProperty("user.name")),

    
   
182
    SCRATCHDIRPERMISSION("hive.scratch.dir.permission", "700"),
182
    SUBMITVIACHILD("hive.exec.submitviachild", false),
183
    SUBMITVIACHILD("hive.exec.submitviachild", false),
183
    SCRIPTERRORLIMIT("hive.exec.script.maxerrsize", 100000),
184
    SCRIPTERRORLIMIT("hive.exec.script.maxerrsize", 100000),
184
    ALLOWPARTIALCONSUMP("hive.exec.script.allow.partial.consumption", false),
185
    ALLOWPARTIALCONSUMP("hive.exec.script.allow.partial.consumption", false),
185
    COMPRESSRESULT("hive.exec.compress.output", false),
186
    COMPRESSRESULT("hive.exec.compress.output", false),
186
    COMPRESSINTERMEDIATE("hive.exec.compress.intermediate", false),
187
    COMPRESSINTERMEDIATE("hive.exec.compress.intermediate", false),
[+20] [20] 1056 lines
ql/src/java/org/apache/hadoop/hive/ql/Context.java
Revision 5340e99 New Change
 
  1. common/src/java/org/apache/hadoop/hive/conf/HiveConf.java: Loading...
  2. ql/src/java/org/apache/hadoop/hive/ql/Context.java: Loading...