You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by co...@apache.org on 2015/08/31 02:50:31 UTC
incubator-sentry git commit: SENTRY-746: After revoke select from
view, select fails with a confusing error message(Colin Ma,
reviewed by: Dapeng Sun)
Repository: incubator-sentry
Updated Branches:
refs/heads/master e90a1b663 -> b99fa7559
SENTRY-746: After revoke select from view, select fails with a confusing error message(Colin Ma, reviewed by: Dapeng Sun)
Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/b99fa755
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/b99fa755
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/b99fa755
Branch: refs/heads/master
Commit: b99fa755918cb8655569c000a72de945ada6507c
Parents: e90a1b6
Author: Colin Ma <co...@apache.org>
Authored: Mon Aug 31 08:25:57 2015 +0800
Committer: Colin Ma <co...@apache.org>
Committed: Mon Aug 31 08:25:57 2015 +0800
----------------------------------------------------------------------
.../apache/sentry/binding/hive/HiveAuthzBindingHook.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/b99fa755/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java
----------------------------------------------------------------------
diff --git a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java
index 62410c7..fd801a4 100644
--- a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java
+++ b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/hive/HiveAuthzBindingHook.java
@@ -363,9 +363,14 @@ public class HiveAuthzBindingHook extends AbstractSemanticAnalyzerHook {
permsRequired += perm + ";";
}
SessionState.get().getConf().set(HiveAuthzConf.HIVE_SENTRY_AUTH_ERRORS, permsRequired);
- String msg = HiveAuthzConf.HIVE_SENTRY_PRIVILEGE_ERROR_MESSAGE + "\n Required privileges for this query: "
+ String msgForLog = HiveAuthzConf.HIVE_SENTRY_PRIVILEGE_ERROR_MESSAGE
+ + "\n Required privileges for this query: "
+ permsRequired;
- throw new SemanticException(msg, e);
+ String msgForConsole = HiveAuthzConf.HIVE_SENTRY_PRIVILEGE_ERROR_MESSAGE + "\n "
+ + e.getMessage();
+ // AuthorizationException is not a real exception, use the info level to record this.
+ LOG.info(msgForLog);
+ throw new SemanticException(msgForConsole, e);
} finally {
hiveAuthzBinding.close();
}