From commits-return-4352-archive-asf-public=cust-asf.ponee.io@ranger.apache.org Fri Mar 23 06:32:56 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id AD28318064D for ; Fri, 23 Mar 2018 06:32:55 +0100 (CET) Received: (qmail 10378 invoked by uid 500); 23 Mar 2018 05:32:54 -0000 Mailing-List: contact commits-help@ranger.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ranger.apache.org Delivered-To: mailing list commits@ranger.apache.org Received: (qmail 10360 invoked by uid 99); 23 Mar 2018 05:32:54 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Mar 2018 05:32:54 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E3EAAF6778; Fri, 23 Mar 2018 05:32:53 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rmani@apache.org To: commits@ranger.apache.org Message-Id: <27df0843c3e143a2959b27a22ee85bd0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: ranger git commit: RANGER-2023: Hive test connection / lookup failed in kerberos cluster Date: Fri, 23 Mar 2018 05:32:53 +0000 (UTC) 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 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 Authored: Thu Mar 15 12:11:51 2018 -0700 Committer: rmani 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) {