You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2020/10/27 19:21:10 UTC

[GitHub] [hive] yongzhi commented on a change in pull request #1590: HIVE-24288: Temp files created by CompileProcessor are not deleted (N…

yongzhi commented on a change in pull request #1590:
URL: https://github.com/apache/hive/pull/1590#discussion_r512948993



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/processors/CompileProcessor.java
##########
@@ -241,6 +255,14 @@ CommandProcessorResponse compile(SessionState ss) throws CommandProcessorExcepti
         out.closeArchiveEntry();
       }
       out.finish();
+      try {
+        Set<PosixFilePermission> perms = EnumSet.of(
+              PosixFilePermission.OWNER_READ,

Review comment:
       Should the permission set at the files create time? 

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/processors/CompileProcessor.java
##########
@@ -241,6 +255,14 @@ CommandProcessorResponse compile(SessionState ss) throws CommandProcessorExcepti
         out.closeArchiveEntry();
       }
       out.finish();
+      try {
+        Set<PosixFilePermission> perms = EnumSet.of(
+              PosixFilePermission.OWNER_READ,
+              PosixFilePermission.OWNER_WRITE);
+        Files.setPosixFilePermissions(Paths.get(testArchive.toURI()), perms);
+      } catch (IOException ioe) {
+        LOG.warn("Lockdown permissions could not be set for the jar archive. JAR file could be open to other users depending on default FS permissions");

Review comment:
       If the IOException here, can you still delete the file later(has the permission)?

##########
File path: ql/src/java/org/apache/hadoop/hive/ql/processors/CompileProcessor.java
##########
@@ -254,6 +276,9 @@ CommandProcessorResponse compile(SessionState ss) throws CommandProcessorExcepti
 
     if (ss != null){
       ss.add_resource(ResourceType.JAR, testArchive.getAbsolutePath());
+      try {
+        testArchive.deleteOnExit();

Review comment:
       Will this jar file be added several times to resource? If not, could it is possible to just delete it and use what is in resource? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org