ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject ranger git commit: RANGER-2023: Hive test connection / lookup failed in kerberos cluster
Date Fri, 23 Mar 2018 05:32:53 GMT
Repository: ranger
Updated Branches:
  refs/heads/ranger-1.0 d8a0e1072 -> 94aa01252


RANGER-2023: Hive test connection / lookup failed in kerberos cluster

Signed-off-by: rmani <rmani@hortonworks.com>


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

Branch: refs/heads/ranger-1.0
Commit: 94aa01252649cfb23c94645e4397e78553b869ea
Parents: d8a0e10
Author: rmani <rmani@hortonworks.com>
Authored: Thu Mar 15 12:11:51 2018 -0700
Committer: rmani <rmani@hortonworks.com>
Committed: Thu Mar 22 22:32:44 2018 -0700

----------------------------------------------------------------------
 .../ranger/services/hive/client/HiveClient.java | 22 ++++++++++----------
 1 file changed, 11 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/94aa0125/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java
----------------------------------------------------------------------
diff --git a/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java
b/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java
index 265c015..bf1bc1d 100644
--- a/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java
+++ b/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveClient.java
@@ -705,23 +705,23 @@ public class HiveClient extends BaseClient implements Closeable {
 				}
 			}
 
-			String decryptedPwd = null;
-			try {
-				decryptedPwd = PasswordUtils.decryptPassword(password);
-			} catch (Exception ex) {
-				LOG.info("Password decryption failed; trying Hive connection with received password string");
-				decryptedPwd = null;
-			} finally {
-				if (decryptedPwd == null) {
-					decryptedPwd = password;
-				}
-			}
 
 			try {
 
 				if (userName == null && password == null) {
 					con = DriverManager.getConnection(url);
 				} else {
+					String decryptedPwd = null;
+					try {
+						decryptedPwd = PasswordUtils.decryptPassword(password);
+					} catch (Exception ex) {
+						LOG.info("Password decryption failed; trying Hive connection with received password
string");
+						decryptedPwd = null;
+					} finally {
+						if (decryptedPwd == null) {
+							decryptedPwd = password;
+						}
+					}
 					con = DriverManager.getConnection(url, userName, decryptedPwd);
 				}
 			} catch (SQLException e) {


Mime
View raw message