diff --git a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java index 91d5e8f..3f30672 100644 --- a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java +++ b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java @@ -674,17 +674,19 @@ public void hflush(FSDataOutputStream stream) throws IOException { } @Override - public HdfsFileStatus getFullFileStatus(Configuration conf, FileSystem fs, - Path file) throws IOException { + public HdfsFileStatus getFullFileStatus(Configuration conf, FileSystem fs, Path file) + throws IOException { FileStatus fileStatus = fs.getFileStatus(file); AclStatus aclStatus = null; - if (isExtendedAclEnabled(conf)) { - //Attempt extended Acl operations only if its enabled, but don't fail the operation regardless. + FsPermission targetPerm = fileStatus.getPermission(); + if (targetPerm.getAclBit()) { + // Attempt extended Acl operations only if its enabled, but don't fail the operation + // regardless. try { aclStatus = fs.getAclStatus(file); - } catch (Exception e) { - LOG.info("Skipping ACL inheritance: File system for path " + file + " " + - "does not support ACLs but dfs.namenode.acls.enabled is set to true: " + e, e); + } catch (UnsupportedOperationException e) { + LOG.info("Skipping ACL inheritance: File system for path " + file + " " + + "does not support ACLs but dfs.namenode.acls.enabled is set to true: " + e, e); } } return new Hadoop23FileStatus(fileStatus, aclStatus);