ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ab...@apache.org
Subject ranger git commit: RANGER-2007: ranger-tagsync's Kerberos ticket fails to renew
Date Tue, 06 Mar 2018 01:22:53 GMT
Repository: ranger
Updated Branches:
  refs/heads/master 52f5249bb -> f96a9276f


RANGER-2007: ranger-tagsync's Kerberos ticket fails to renew


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

Branch: refs/heads/master
Commit: f96a9276f1b3ed920735e550a5c1cfe5cf560fe7
Parents: 52f5249
Author: Abhay Kulkarni <akulkarni@hortonworks.com>
Authored: Mon Mar 5 17:02:57 2018 -0800
Committer: Abhay Kulkarni <akulkarni@hortonworks.com>
Committed: Mon Mar 5 17:02:57 2018 -0800

----------------------------------------------------------------------
 .../ranger/tagsync/process/TagSynchronizer.java | 33 +++++++-------------
 1 file changed, 12 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/f96a9276/tagsync/src/main/java/org/apache/ranger/tagsync/process/TagSynchronizer.java
----------------------------------------------------------------------
diff --git a/tagsync/src/main/java/org/apache/ranger/tagsync/process/TagSynchronizer.java
b/tagsync/src/main/java/org/apache/ranger/tagsync/process/TagSynchronizer.java
index 45997e4..49ff76f 100644
--- a/tagsync/src/main/java/org/apache/ranger/tagsync/process/TagSynchronizer.java
+++ b/tagsync/src/main/java/org/apache/ranger/tagsync/process/TagSynchronizer.java
@@ -28,7 +28,6 @@ import org.apache.log4j.Logger;
 import org.apache.ranger.tagsync.model.TagSink;
 import org.apache.ranger.tagsync.model.TagSource;
 
-import javax.security.auth.Subject;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
@@ -380,31 +379,23 @@ public class TagSynchronizer {
 			if (LOG.isDebugEnabled()) {
 				LOG.debug("Trying to get kerberos identitiy");
 			}
-			Subject subject = null;
-			try {
-				subject = SecureClientLogin.loginUserFromKeytab(principal, keytab, nameRules);
-			} catch(IOException exception) {
-				LOG.error("Could not get Subject from principal:[" + principal + "], keytab:[" + keytab
+ "], nameRules:[" + nameRules + "]", exception);
-			}
 
 			UserGroupInformation kerberosIdentity;
 
-			if (subject != null) {
-				try {
-					UserGroupInformation.loginUserFromSubject(subject);
-					kerberosIdentity = UserGroupInformation.getLoginUser();
-					if (kerberosIdentity != null) {
-						props.put(TagSyncConfig.TAGSYNC_KERBEROS_IDENTITY, kerberosIdentity.getUserName());
-						if (LOG.isDebugEnabled()) {
-							LOG.debug("Got UGI, user:[" + kerberosIdentity.getUserName() + "]");
-						}
-						ret = true;
-					} else {
-						LOG.error("KerberosIdentity is null!");
+			try {
+				UserGroupInformation.loginUserFromKeytab(principal, keytab);
+				kerberosIdentity = UserGroupInformation.getLoginUser();
+				if (kerberosIdentity != null) {
+					props.put(TagSyncConfig.TAGSYNC_KERBEROS_IDENTITY, kerberosIdentity.getUserName());
+					if (LOG.isDebugEnabled()) {
+						LOG.debug("Got UGI, user:[" + kerberosIdentity.getUserName() + "]");
 					}
-				} catch (IOException exception) {
-					LOG.error("Failed to get UGI from Subject:[" + subject + "]", exception);
+					ret = true;
+				} else {
+					LOG.error("KerberosIdentity is null!");
 				}
+			} catch (IOException exception) {
+				LOG.error("Failed to get UGI from principal:[" + principal + "], and keytab:[" + keytab
+ "]", exception);
 			}
 		} else {
 			if (LOG.isDebugEnabled()) {


Mime
View raw message