sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [03/25] incubator-sentry git commit: SENTRY-746: After revoke select from view, select fails with a confusing error message(Colin Ma, reviewed by: Dapeng Sun)
Date Thu, 05 Nov 2015 01:44:31 GMT
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/5c2333c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/5c2333c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/5c2333c1

Branch: refs/heads/hive_plugin_v2
Commit: 5c2333c17f86280edbc94086046d997e8cd63e8c
Parents: fdc7e25
Author: Colin Ma <colin@apache.org>
Authored: Mon Aug 31 08:25:57 2015 +0800
Committer: Sun Dapeng <sdp@apache.org>
Committed: Mon Nov 2 12:47:42 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/5c2333c1/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();
     }


Mime
View raw message