You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sentry.apache.org by ak...@apache.org on 2017/02/08 07:27:18 UTC
sentry git commit: SENTRY-1624: DefaultSentryValidator doesn't
correctly construct SentryOnFailureHookContextImpl (Alex Kolbasov,
Reviewed by: Nachiket Vaidya)
Repository: sentry
Updated Branches:
refs/heads/master c4afd37b4 -> 938b2c2ba
SENTRY-1624: DefaultSentryValidator doesn't correctly construct SentryOnFailureHookContextImpl (Alex Kolbasov, Reviewed by: Nachiket Vaidya)
Project: http://git-wip-us.apache.org/repos/asf/sentry/repo
Commit: http://git-wip-us.apache.org/repos/asf/sentry/commit/938b2c2b
Tree: http://git-wip-us.apache.org/repos/asf/sentry/tree/938b2c2b
Diff: http://git-wip-us.apache.org/repos/asf/sentry/diff/938b2c2b
Branch: refs/heads/master
Commit: 938b2c2baded5542365f5d77cab72ce25d8077f6
Parents: c4afd37
Author: Alexander Kolbasov <ak...@cloudera.com>
Authored: Tue Feb 7 23:26:33 2017 -0800
Committer: Alexander Kolbasov <ak...@cloudera.com>
Committed: Tue Feb 7 23:26:33 2017 -0800
----------------------------------------------------------------------
.../binding/hive/v2/authorizer/DefaultSentryValidator.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/sentry/blob/938b2c2b/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/authorizer/DefaultSentryValidator.java
----------------------------------------------------------------------
diff --git a/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/authorizer/DefaultSentryValidator.java b/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/authorizer/DefaultSentryValidator.java
index c9da3ab..6c2410b 100644
--- a/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/authorizer/DefaultSentryValidator.java
+++ b/sentry-binding/sentry-binding-hive-v2/src/main/java/org/apache/sentry/binding/hive/v2/authorizer/DefaultSentryValidator.java
@@ -18,6 +18,7 @@ import static org.apache.hadoop.hive.metastore.MetaStoreUtils.DEFAULT_DATABASE_N
import java.security.CodeSource;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
@@ -186,8 +187,6 @@ public class DefaultSentryValidator extends SentryHiveAuthorizationValidator {
} catch (AuthorizationException e) {
Database db = null;
Table tab = null;
- AccessURI udfURI = null;
- AccessURI partitionURI = null;
if (outputHObjs != null) {
for (HivePrivilegeObject obj : outputHObjs) {
switch (obj.getType()) {
@@ -209,8 +208,8 @@ public class DefaultSentryValidator extends SentryHiveAuthorizationValidator {
String permsRequired = "";
SentryOnFailureHookContext hookCtx =
new SentryOnFailureHookContextImpl(context.getCommandString(), null, null, hiveOp, db,
- tab, udfURI, partitionURI, authenticator.getUserName(), context.getIpAddress(), e,
- authzConf);
+ tab, Collections.<AccessURI>emptyList(), null,
+ authenticator.getUserName(), context.getIpAddress(), e, authzConf);
SentryAuthorizerUtil.executeOnFailureHooks(hookCtx, authzConf);
for (String perm : hiveAuthzBinding.getLastQueryPrivilegeErrors()) {
permsRequired += perm + ";";