[ 
https://issues.apache.org/jira/browse/SENTRY-470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

guoquanshen updated SENTRY-470:
-------------------------------
    Description: 
The command "use default" will cause an error in Hive Server2 side,but the user 
has some privileges on tables in the default database:   
jdbc:hive2://localhost:10000> use default; 
Error:  Error  while  compiling  statement:  FAILED:  SemanticException  No  
valid  privileges 
(state=42000,code=40000)
Cause of the problem: 
When grant privileges, everything are converted to lower case before store to 
database. 
mSentryPrivilege.setServerName(toNULLCol(safeTrimLower(privilege.getServerName())));
 
While when match the privileges with the server name when authorizing, it 
doesn’t do the 
same conversion: 
filters.append("&& serverName == \"" + serverName + "\""); 
By default, the server name was: HS2 which is upper case. This caused the 
corresponding 
privileges not matched for “use database”. 

> When the parameter of hive.sentry.server is uppercase string, the command 
> "use default" will cause an error in Hive Server2 side
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SENTRY-470
>                 URL: https://issues.apache.org/jira/browse/SENTRY-470
>             Project: Sentry
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: guoquanshen
>            Assignee: guoquanshen
>             Fix For: 1.5.0
>
>
> The command "use default" will cause an error in Hive Server2 side,but the 
> user has some privileges on tables in the default database:   
> jdbc:hive2://localhost:10000> use default; 
> Error:  Error  while  compiling  statement:  FAILED:  SemanticException  No  
> valid  privileges 
> (state=42000,code=40000)
> Cause of the problem: 
> When grant privileges, everything are converted to lower case before store to 
> database. 
> mSentryPrivilege.setServerName(toNULLCol(safeTrimLower(privilege.getServerName())));
>  
> While when match the privileges with the server name when authorizing, it 
> doesn’t do the 
> same conversion: 
> filters.append("&& serverName == \"" + serverName + "\""); 
> By default, the server name was: HS2 which is upper case. This caused the 
> corresponding 
> privileges not matched for “use database”. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to