Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-10507

FsShell setfacl can throw ArrayIndexOutOfBoundsException when no perm is specified

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4.0, 3.0.0-alpha1
    • Fix Version/s: 2.6.0
    • Component/s: fs
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      If users don't specify the perm of an acl when using the FsShell's setfacl command, a fatal internal error ArrayIndexOutOfBoundsException will be thrown.

      [root@hdfs-nfs ~]# hdfs dfs -setfacl -m user:bob: /user/hdfs/td1
      -setfacl: Fatal internal error
      java.lang.ArrayIndexOutOfBoundsException: 2
      	at org.apache.hadoop.fs.permission.AclEntry.parseAclEntry(AclEntry.java:285)
      	at org.apache.hadoop.fs.permission.AclEntry.parseAclSpec(AclEntry.java:221)
      	at org.apache.hadoop.fs.shell.AclCommands$SetfaclCommand.processOptions(AclCommands.java:260)
      	at org.apache.hadoop.fs.shell.Command.run(Command.java:154)
      	at org.apache.hadoop.fs.FsShell.run(FsShell.java:255)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
      	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)
      	at org.apache.hadoop.fs.FsShell.main(FsShell.java:308)
      [root@hdfs-nfs ~]# 
      

      An improvement would be if it returned something like this:

      [root@hdfs-nfs ~]# hdfs dfs -setfacl -m user:bob:rww /user/hdfs/td1
      -setfacl: Invalid permission in <aclSpec> : user:bob:rww
      Usage: hadoop fs [generic options] -setfacl [-R] [{-b|-k} {-m|-x <acl_spec>} <path>]|[--set <acl_spec> <path>]
      [root@hdfs-nfs ~]# 
      

        Attachments

        1. HADOOP-10507.002.patch
          2 kB
          Stephen Chu
        2. HADOOP-10507.002.patch
          2 kB
          Stephen Chu
        3. HDFS-6205.patch
          2 kB
          sathish
        4. HDFS-6205-0001.patch
          2 kB
          sathish

          Issue Links

            Activity

              People

              • Assignee:
                sathish.gurram sathish
                Reporter:
                schu Stephen Chu
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: