You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "sathish (JIRA)" <ji...@apache.org> on 2014/04/09 08:56:16 UTC
[jira] [Commented] (HDFS-6205) FsShell setfacl can throw
ArrayIndexOutOfBoundsException when no perm is specified
[ https://issues.apache.org/jira/browse/HDFS-6205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13963878#comment-13963878 ]
sathish commented on HDFS-6205:
-------------------------------
setfacl command with "-m" option took include permission by default as true.so if we doesn't provide the permissions it will through the ArrayIndexoutofboundexception.
{code}
if (includePermission) {
if (split.length < index) {
throw new HadoopIllegalArgumentException("Invalid <aclSpec> : "
+ aclStr);
}
String permission = split[index];
{code}
actually we are not giving the permision right so we have only two index.so it is checking for third index and throwing the arrayindexout of bound exception
> FsShell setfacl can throw ArrayIndexOutOfBoundsException when no perm is specified
> ----------------------------------------------------------------------------------
>
> Key: HDFS-6205
> URL: https://issues.apache.org/jira/browse/HDFS-6205
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs-client
> Affects Versions: 3.0.0, 2.4.0
> Reporter: Stephen Chu
> Assignee: sathish
> Priority: Minor
>
> 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.
> {code}
> [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 ~]#
> {code}
> An improvement would be if it returned something like this:
> {code}
> [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 ~]#
> {code}
--
This message was sent by Atlassian JIRA
(v6.2#6252)