You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by sd...@apache.org on 2015/11/05 02:44:30 UTC

[02/25] incubator-sentry git commit: SENTRY-739: when user doesn't have admin privileges, show grant throw exception, better improve error message (Colin Ma, Reviewed by: Anne Yu)

SENTRY-739: when user doesn't have admin privileges, show grant throw exception, better improve error message (Colin Ma, Reviewed by: Anne Yu)


Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/fdc7e25c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/fdc7e25c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/fdc7e25c

Branch: refs/heads/hive_plugin_v2
Commit: fdc7e25ce7466aa52be186e6d077dd564945bcfb
Parents: e8424e4
Author: Colin Ma <co...@apache.org>
Authored: Wed Aug 26 13:30:14 2015 +0800
Committer: Sun Dapeng <sd...@apache.org>
Committed: Mon Nov 2 12:47:14 2015 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/fdc7e25c/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java
----------------------------------------------------------------------
diff --git a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java
index 13c2c58..1e2b3b9 100644
--- a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java
+++ b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/hadoop/hive/ql/exec/SentryGrantRevokeTask.java
@@ -165,7 +165,10 @@ public class SentryGrantRevokeTask extends Task<DDLWork> implements Serializable
       }
     } catch(SentryUserException e) {
       setException(new Exception(e.getClass().getSimpleName() + ": " + e.getReason(), e));
-      String msg = "Error processing Sentry command: " + e.getMessage();
+      String msg = "Error processing Sentry command: " + e.getReason() + ".";
+      if (e instanceof SentryAccessDeniedException) {
+        msg += "Please grant admin privilege to " + subject.getName() + ".";
+      }
       LOG.error(msg, e);
       console.printError(msg);
       return RETURN_CODE_FAILURE;