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-1772: Permissions created before table creation are not reflected in HDFS ACLs (Alex Kolbasov, reviewed by: Vamsee Yarlagadda)
Date Fri, 19 May 2017 06:03:48 GMT
Repository: sentry
Updated Branches:
  refs/heads/sentry-ha-redesign 68ed22c15 -> 5a2322338


SENTRY-1772: Permissions created before table creation are not reflected in HDFS ACLs (Alex
Kolbasov, reviewed by: Vamsee Yarlagadda)


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

Branch: refs/heads/sentry-ha-redesign
Commit: 5a2322338749cf5cf3f1a2b7e87645926ce469f1
Parents: 68ed22c
Author: Alexander Kolbasov <akolb@cloudera.com>
Authored: Thu May 18 23:03:10 2017 -0700
Committer: Alexander Kolbasov <akolb@cloudera.com>
Committed: Thu May 18 23:03:10 2017 -0700

----------------------------------------------------------------------
 .../org/apache/sentry/service/thrift/HMSFollower.java |  2 +-
 .../sentry/service/thrift/NotificationProcessor.java  |  2 +-
 .../apache/sentry/service/thrift/TestHMSFollower.java | 14 +++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sentry/blob/5a232233/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
index 5dc0ad3..72e9d72 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java
@@ -411,7 +411,7 @@ public class HMSFollower implements Runnable, AutoCloseable {
 
   private boolean syncWithPolicyStore(HiveAuthzConf.AuthzConfVars syncConfVar) {
     return "true"
-        .equalsIgnoreCase((authzConf.get(syncConfVar.getVar(), "true")));
+        .equalsIgnoreCase((authzConf.get(syncConfVar.getVar(), syncConfVar.getDefault())));
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/sentry/blob/5a232233/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java
index 083e0ac..9f4cfe8 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/NotificationProcessor.java
@@ -372,7 +372,7 @@ class NotificationProcessor {
     try {
       return PathsUpdate.parsePath(path);
     } catch (SentryMalformedPathException e) {
-      LOGGER.error("Unexpected path while parsing, " + path, e.getMessage());
+      LOGGER.error("Unexpected path while parsing {}", path, e);
     }
     return null;
   }

http://git-wip-us.apache.org/repos/asf/sentry/blob/5a232233/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java
b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java
index fd97936..74a5afb 100644
--- a/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java
+++ b/sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestHMSFollower.java
@@ -42,7 +42,7 @@ public class TestHMSFollower {
 
     // Create notification events
     NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.CREATE_DATABASE.toString(),
-        messageFactory.buildCreateDatabaseMessage(new Database(dbName, null, "hdfs://db1",
null)).toString());
+        messageFactory.buildCreateDatabaseMessage(new Database(dbName, null, "hdfs:///db1",
null)).toString());
     List<NotificationEvent> events = new ArrayList<>();
     events.add(notificationEvent);
 
@@ -54,7 +54,7 @@ public class TestHMSFollower {
     authorizable.setServer(hiveInstance);
     authorizable.setDb("db1");
 
-    verify(sentryStore, times(1)).dropPrivilege(authorizable, HMSFollower.onDropSentryPrivilege(authorizable));
+    verify(sentryStore, times(0)).dropPrivilege(authorizable, HMSFollower.onDropSentryPrivilege(authorizable));
   }
 
   @Test
@@ -63,7 +63,7 @@ public class TestHMSFollower {
 
     // Create notification events
     NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.DROP_DATABASE.toString(),
-        messageFactory.buildDropDatabaseMessage(new Database(dbName, null, "hdfs://db1",
null)).toString());
+        messageFactory.buildDropDatabaseMessage(new Database(dbName, null, "hdfs:///db1",
null)).toString());
     List<NotificationEvent> events = new ArrayList<>();
     events.add(notificationEvent);
 
@@ -84,7 +84,7 @@ public class TestHMSFollower {
 
     // Create notification events
     StorageDescriptor sd = new StorageDescriptor();
-    sd.setLocation("hdfs://db1.db/table1");
+    sd.setLocation("hdfs:///db1.db/table1");
     NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.CREATE_TABLE.toString(),
         messageFactory.buildCreateTableMessage(new Table(tableName, dbName, null, 0, 0, 0,
sd, null, null, null, null, null)).toString());
     List<NotificationEvent> events = new ArrayList<>();
@@ -99,7 +99,7 @@ public class TestHMSFollower {
     authorizable.setDb("db1");
     authorizable.setTable(tableName);
 
-    verify(sentryStore, times(1)).dropPrivilege(authorizable, HMSFollower.onDropSentryPrivilege(authorizable));
+    verify(sentryStore, times(0)).dropPrivilege(authorizable, HMSFollower.onDropSentryPrivilege(authorizable));
   }
   @Test
   public void testDropTable() throws Exception {
@@ -108,7 +108,7 @@ public class TestHMSFollower {
 
     // Create notification events
     StorageDescriptor sd = new StorageDescriptor();
-    sd.setLocation("hdfs://db1.db/table1");
+    sd.setLocation("hdfs:///db1.db/table1");
     NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.DROP_TABLE.toString(),
         messageFactory.buildDropTableMessage(new Table(tableName, dbName, null, 0, 0, 0,
sd, null, null, null, null, null)).toString());
     List<NotificationEvent> events = new ArrayList<>();
@@ -135,7 +135,7 @@ public class TestHMSFollower {
 
     // Create notification events
     StorageDescriptor sd = new StorageDescriptor();
-    sd.setLocation("hdfs://db1.db/table1");
+    sd.setLocation("hdfs:///db1.db/table1");
     NotificationEvent notificationEvent = new NotificationEvent(1, 0, HCatEventMessage.EventType.ALTER_TABLE.toString(),
         messageFactory.buildAlterTableMessage(
             new Table(tableName, dbName, null, 0, 0, 0, sd, null, null, null, null, null),


Mime
View raw message