[
https://issues.apache.org/jira/browse/HBASE-15297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15485662#comment-15485662
]
Umesh Agashe commented on HBASE-15297:
--------------------------------------
[~busbey] thats right! I tested is manually by enabling security on a
standalone instance. Reproduced the problem without these changes and verified
the behavior after applying the code changes. Here is the fixed output;
{code}
hbase(main):001:0> grant 'a1', 'R', '@aaa'
ERROR: Can't find a namespace: aaa
Here is some help for this command:
Grant users specific rights.
Syntax : grant <user>, <permissions> [, <@namespace> [, <table> [, <column
family> [, <column qualifier>]]]
permissions is either zero or more letters from the set "RWXCA".
READ('R'), WRITE('W'), EXEC('X'), CREATE('C'), ADMIN('A')
Note: Groups and users are granted access in the same way, but groups are
prefixed with an '@'
character. In the same way, tables and namespaces are specified, but
namespaces are
prefixed with an '@' character.
For example:
hbase> grant 'bobsmith', 'RWXCA'
hbase> grant '@admins', 'RWXCA'
hbase> grant 'bobsmith', 'RWXCA', '@ns1'
hbase> grant 'bobsmith', 'RW', 't1', 'f1', 'col1'
hbase> grant 'bobsmith', 'RW', 'ns1:t1', 'f1', 'col1'
Took 0.3230 seconds
{code}
> error message is wrong when a wrong namspace is specified in grant in hbase
> shell
> ---------------------------------------------------------------------------------
>
> Key: HBASE-15297
> URL: https://issues.apache.org/jira/browse/HBASE-15297
> Project: HBase
> Issue Type: Bug
> Components: shell
> Affects Versions: 2.0.0, 1.2.0
> Reporter: Xiang Li
> Assignee: Umesh Agashe
> Priority: Minor
> Fix For: 2.0.0, 1.3.0, 1.4.0, 1.2.4
>
> Attachments: HBASE-15297.v1.patch
>
>
> In HBase shell, specify a non-existing namespace in "grant" command, such as
> {code}
> hbase(main):001:0> grant 'a1', 'R', '@aaa' <--- there is no namespace
> called "aaa"
> {code}
> The error message issued is not correct
> {code}
> ERROR: Unknown namespace a1!
> {code}
> a1 is the user name, not the namespace.
> The following error message would be better
> {code}
> ERROR: Unknown namespace aaa!
> {code}
> or
> {code}
> Can't find a namespace: aaa
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)