diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java index 67f5cc0d0d..9540c2a25b 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java @@ -74,7 +74,7 @@ protected void processOptions(LinkedList args) throws IOException { @Override protected void processPath(PathData item) throws IOException { AclStatus aclStatus = item.fs.getAclStatus(item.path); - out.println("# file: " + item.path); + out.println("# file: " + item); out.println("# owner: " + aclStatus.getOwner()); out.println("# group: " + aclStatus.getGroup()); List entries = aclStatus.getEntries(); @@ -97,6 +97,7 @@ protected void processPath(PathData item) throws IOException { } else { printMinimalAcl(perm); } + out.println(); } /** diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Ls.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Ls.java index 76192e73b4..a85e8d7191 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Ls.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/Ls.java @@ -60,7 +60,8 @@ public static void registerCommands(CommandFactory factory) { protected static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); - protected int maxRepl = 3, maxLen = 10, maxOwner = 0, maxGroup = 0; + protected int maxPerm = 9, maxRepl = 3, maxLen = 10, maxOwner = 0, + maxGroup = 0; protected String lineFormat; protected boolean dirRecurse; @@ -125,6 +126,7 @@ protected void processPath(PathData item) throws IOException { private void adjustColumnWidths(PathData items[]) { for (PathData item : items) { FileStatus stat = item.stat; + maxPerm = maxLength(maxPerm, stat.getPermission()); maxRepl = maxLength(maxRepl, stat.getReplication()); maxLen = maxLength(maxLen, stat.getLen()); maxOwner = maxLength(maxOwner, stat.getOwner()); @@ -132,7 +134,7 @@ private void adjustColumnWidths(PathData items[]) { } StringBuilder fmt = new StringBuilder(); - fmt.append("%s%s "); // permission string + fmt.append("%s%-" + maxPerm + "s "); // permission string fmt.append("%" + maxRepl + "s "); // Do not use '%-0s' as a formatting conversion, since it will throw a // a MissingFormatWidthException if it is used in String.format(). diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-4685.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-4685.txt index c1bd3accef..f278ee3da2 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-4685.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES-HDFS-4685.txt @@ -42,6 +42,8 @@ HDFS-4685 (Unreleased) HDFS-5615. NameNode: implement handling of ACLs in combination with sticky bit. (Chris Nauroth via wheat9) + HADOOP-10241. Clean up output of FsShell getfacl. (Chris Nauroth via wheat9) + OPTIMIZATIONS BUG FIXES