You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by "guoquanshen (JIRA)" <ji...@apache.org> on 2014/09/26 02:53:33 UTC
[jira] [Updated] (SENTRY-470) When the parameter of
hive.sentry.server is uppercase string, the command "use default" will
cause an error in Hive Server2 side
[ 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)