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

guoquanshen updated SENTRY-470:
-------------------------------
    Attachment: SENTRY-470.patch

> 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
>
>         Attachments: SENTRY-470.patch
>
>
> 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. 
> {code}
> mSentryPrivilege.setServerName(toNULLCol(safeTrimLower(privilege.getServerName())));
> {code} 
> While when match the privileges with the server name when authorizing, it 
> doesn’t do the 
> same conversion:
> {code} 
> filters.append("&& serverName == \"" + serverName + "\"");
> {code} 
> 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