sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pras...@apache.org
Subject git commit: SENTRY-484: Sentry Service has does not audit ip address in secure environments (Lenni Kuff via Prasad Mujumdar)
Date Wed, 01 Oct 2014 21:40:06 GMT
Repository: incubator-sentry
Updated Branches:
  refs/heads/master 1e0bbb733 -> 1cd882208


SENTRY-484: Sentry Service has does not audit ip address in secure environments (Lenni Kuff
via Prasad Mujumdar)


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

Branch: refs/heads/master
Commit: 1cd88220831ebcd95cb42150dbbfd186f9573447
Parents: 1e0bbb7
Author: Prasad Mujumdar <prasadm@cloudera.com>
Authored: Wed Oct 1 14:39:59 2014 -0700
Committer: Prasad Mujumdar <prasadm@cloudera.com>
Committed: Wed Oct 1 14:39:59 2014 -0700

----------------------------------------------------------------------
 .../service/thrift/SentryProcessorWrapper.java  | 21 ++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/1cd88220/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryProcessorWrapper.java
----------------------------------------------------------------------
diff --git a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryProcessorWrapper.java
b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryProcessorWrapper.java
index 33e741d..6f3508d 100644
--- a/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryProcessorWrapper.java
+++ b/sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryProcessorWrapper.java
@@ -30,6 +30,8 @@ import org.apache.thrift.transport.TTransport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.base.Preconditions;
+
 public class SentryProcessorWrapper<I extends SentryPolicyService.Iface> extends
     SentryPolicyService.Processor<SentryPolicyService.Iface> {
 
@@ -68,15 +70,18 @@ public class SentryProcessorWrapper<I extends SentryPolicyService.Iface>
extends
     CommandUtil.setIpAddress(socket.getInetAddress().toString());
   }
 
+  /**
+   * Returns the underlying TSocket from the transport, or null of the transport type is
+   * unknown.
+   */
   private TSocket getUnderlyingSocketFromTransport(TTransport transport) {
-    if (transport != null) {
-      if (transport instanceof TSaslServerTransport) {
-        transport = ((TSaslServerTransport) transport).getUnderlyingTransport();
-      } else if (transport instanceof TSaslClientTransport) {
-        transport = ((TSaslClientTransport) transport).getUnderlyingTransport();
-      } else if (transport instanceof TSocket) {
-        return (TSocket) transport;
-      }
+    Preconditions.checkNotNull(transport);
+    if (transport instanceof TSaslServerTransport) {
+      return (TSocket) ((TSaslServerTransport) transport).getUnderlyingTransport();
+    } else if (transport instanceof TSaslClientTransport) {
+      return (TSocket) ((TSaslClientTransport) transport).getUnderlyingTransport();
+    } else if (transport instanceof TSocket) {
+      return (TSocket) transport;
     }
     return null;
   }


Mime
View raw message