You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by st...@apache.org on 2020/03/11 16:40:58 UTC

[phoenix-queryserver] branch master updated: PHOENIX-5761 sqlline-thin kerberos logic too aggressive

This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-queryserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 8e927b0  PHOENIX-5761 sqlline-thin kerberos logic too aggressive
8e927b0 is described below

commit 8e927b00fa6a7a35a068b20eba2c6f54c328cf75
Author: Istvan Toth <st...@apache.org>
AuthorDate: Mon Mar 9 10:57:14 2020 +0100

    PHOENIX-5761 sqlline-thin kerberos logic too aggressive
---
 .../java/org/apache/phoenix/queryserver/client/SqllineWrapper.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/queryserver-client/src/main/java/org/apache/phoenix/queryserver/client/SqllineWrapper.java b/queryserver-client/src/main/java/org/apache/phoenix/queryserver/client/SqllineWrapper.java
index 7a22334..90fe8e1 100644
--- a/queryserver-client/src/main/java/org/apache/phoenix/queryserver/client/SqllineWrapper.java
+++ b/queryserver-client/src/main/java/org/apache/phoenix/queryserver/client/SqllineWrapper.java
@@ -32,7 +32,7 @@ public class SqllineWrapper {
   public static final String QUERY_SERVER_SPNEGO_AUTH_DISABLED_ATTRIB = "phoenix.queryserver.spnego.auth.disabled";
   public static final boolean DEFAULT_QUERY_SERVER_SPNEGO_AUTH_DISABLED = false;
 
-  static UserGroupInformation loginIfNecessary(Configuration conf) {
+  static UserGroupInformation tryLogin(Configuration conf) {
     // Try to avoid HBase dependency too. Sadly, we have to bring in all of hadoop-common for this..
     if ("kerberos".equalsIgnoreCase(conf.get(HBASE_AUTHENTICATION_ATTR))) {
       // sun.security.krb5.principal is the property for setting the principal name, if that
@@ -42,7 +42,8 @@ public class SqllineWrapper {
         // We got hadoop-auth via hadoop-common, so might as well use it.
         return UserGroupInformation.getUGIFromTicketCache(null, principal);
       } catch (Exception e) {
-        throw new RuntimeException("Kerberos login failed using ticket cache. Did you kinit?", e);
+        //Fall through
+        System.err.println("Kerberos login failed using ticket cache. Did you kinit?");
       }
     }
     return null;
@@ -78,7 +79,7 @@ public class SqllineWrapper {
       SqlLine.main(args);
     }
 
-    UserGroupInformation ugi = loginIfNecessary(conf);
+    UserGroupInformation ugi = tryLogin(conf);
 
     if (null != ugi) {
       final String[] updatedArgs = updateArgsForKerberos(args);