Repository: incubator-impala
Updated Branches:
  refs/heads/master b20f45962 -> 796db0fce


KUDU-1942. Kerberos fails to log in on hostnames with capital letters

This ensures that servers canonicalize their FQDNs to lower-case before
generating Kerberos principal names.

With this change I was able to set up a working cluster on my laptop
with a capitalized hostname, where before it would fail as described in
the JIRA.

I also verified that I was able to connect from both C++ and Java
clients.

Change-Id: I5ef65dd827459476a2d225d8e3f7c80ff2fdf627
Reviewed-on: http://gerrit.cloudera.org:8080/7693
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <[email protected]>
Reviewed-on: http://gerrit.cloudera.org:8080/7893
Reviewed-by: Sailesh Mukil <[email protected]>
Tested-by: Sailesh Mukil <[email protected]>


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

Branch: refs/heads/master
Commit: d1239a9b49131825f2949671f1f9b85cce199c68
Parents: b20f459
Author: Todd Lipcon <[email protected]>
Authored: Wed Aug 16 19:08:14 2017 -0700
Committer: Sailesh Mukil <[email protected]>
Committed: Fri Sep 1 03:08:51 2017 +0000

----------------------------------------------------------------------
 be/src/kudu/security/init.cc | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/d1239a9b/be/src/kudu/security/init.cc
----------------------------------------------------------------------
diff --git a/be/src/kudu/security/init.cc b/be/src/kudu/security/init.cc
index dfbb25c..c1e94ed 100644
--- a/be/src/kudu/security/init.cc
+++ b/be/src/kudu/security/init.cc
@@ -17,6 +17,7 @@
 
 #include "kudu/security/init.h"
 
+#include <ctype.h>
 #include <krb5/krb5.h>
 
 #include <algorithm>
@@ -394,6 +395,8 @@ Status GetConfiguredPrincipal(string* principal) {
   if (!GetFQDN(&hostname).ok()) {
     RETURN_NOT_OK(GetHostname(&hostname));
   }
+  // Hosts in principal names are canonicalized to lower-case.
+  std::transform(hostname.begin(), hostname.end(), hostname.begin(), tolower);
   GlobalReplaceSubstring("_HOST", hostname, &p);
   *principal = p;
   return Status::OK();

Reply via email to