BIGTOP-2673: Need to back port HADOOP-11628 for JDK8
authorOlaf Flebbe <of@oflebbe.de>
Sun, 19 Mar 2017 14:09:58 +0000 (15:09 +0100)
committerOlaf Flebbe <of@oflebbe.de>
Sun, 19 Mar 2017 14:09:58 +0000 (15:09 +0100)
bigtop-packages/src/common/hadoop/patch1-HADOOP-11628.diff [new file with mode: 0644]

diff --git a/bigtop-packages/src/common/hadoop/patch1-HADOOP-11628.diff b/bigtop-packages/src/common/hadoop/patch1-HADOOP-11628.diff
new file mode 100644 (file)
index 0000000..1c2de37
--- /dev/null
@@ -0,0 +1,22 @@
+diff --git a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/KerberosAuthenticationHandler.java b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/KerberosAuthenticationHandler.java
+index 9852460..8cd39c7 100644
+--- a/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/KerberosAuthenticationHandler.java
++++ b/hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/server/KerberosAuthenticationHandler.java
+@@ -37,6 +37,7 @@
+ import java.io.File;
+ import java.io.IOException;
++import java.net.InetAddress;
+ import java.security.PrivilegedActionException;
+ import java.security.PrivilegedExceptionAction;
+ import java.util.ArrayList;
+@@ -343,7 +344,8 @@ public AuthenticationToken authenticate(HttpServletRequest request, final HttpSe
+       authorization = authorization.substring(KerberosAuthenticator.NEGOTIATE.length()).trim();
+       final Base64 base64 = new Base64(0);
+       final byte[] clientToken = base64.decode(authorization);
+-      final String serverName = request.getServerName();
++      final String serverName = InetAddress.getByName(request.getServerName())
++                                           .getCanonicalHostName();
+       try {
+         token = Subject.doAs(serverSubject, new PrivilegedExceptionAction<AuthenticationToken>() {