sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ak...@apache.org
Subject sentry git commit: SENTRY-1377: improve handling of failures, both in tests and after-test cleanup, in TestHDFSIntegration.java (Vadim Spector, Reviewed by: Sravya Tirukkovalur and Hao Hao)
Date Sat, 11 Mar 2017 01:25:40 GMT
Repository: sentry
Updated Branches:
  refs/heads/sentry-ha-redesign 8f5c17dbc -> 2fbaacc8e


SENTRY-1377: improve handling of failures, both in tests and after-test cleanup, in TestHDFSIntegration.java
(Vadim Spector, Reviewed by: Sravya Tirukkovalur and Hao Hao)


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

Branch: refs/heads/sentry-ha-redesign
Commit: 2fbaacc8e11dbd5a63922ec8051854b39857b85b
Parents: 8f5c17d
Author: Alexander Kolbasov <akolb@cloudera.com>
Authored: Fri Mar 10 17:23:16 2017 -0800
Committer: Alexander Kolbasov <akolb@cloudera.com>
Committed: Fri Mar 10 17:23:16 2017 -0800

----------------------------------------------------------------------
 .../org/apache/sentry/hdfs/UpdateableAuthzPermissions.java  | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/2fbaacc8/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPermissions.java
----------------------------------------------------------------------
diff --git a/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPermissions.java
b/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPermissions.java
index 766611c..03b4cac 100644
--- a/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPermissions.java
+++ b/sentry-hdfs/sentry-hdfs-namenode-plugin/src/main/java/org/apache/sentry/hdfs/UpdateableAuthzPermissions.java
@@ -205,7 +205,14 @@ public class UpdateableAuthzPermissions implements AuthzPermissions,
Updateable<
     String[] strPrivs = sentryPriv.trim().split(",");
     FsAction retVal = FsAction.NONE;
     for (String strPriv : strPrivs) {
-      retVal = retVal.or(ACTION_MAPPING.get(strPriv.toUpperCase()));
+      FsAction action = ACTION_MAPPING.get(strPriv.toUpperCase());
+      /* Passing null to FsAction.or() method causes NullPointerException.
+       * Better to throw more informative exception instead
+       */
+      if (action == null) {
+        throw new IllegalArgumentException("Unsupported Action " + strPriv);
+      }
+      retVal = retVal.or(action);
     }
     return retVal;
   }


Mime
View raw message