sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [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)
Date Thu, 05 Nov 2015 01:44:30 GMT
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 <colin@apache.org>
Authored: Wed Aug 26 13:30:14 2015 +0800
Committer: Sun Dapeng <sdp@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;


Mime
View raw message