hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiten...@apache.org
Subject svn commit: r1236966 - in /hadoop/common/branches/branch-1.0: CHANGES.txt src/core/org/apache/hadoop/security/SecurityUtil.java src/test/org/apache/hadoop/security/TestSecurityUtil.java
Date Sat, 28 Jan 2012 02:51:55 GMT
Author: jitendra
Date: Sat Jan 28 02:51:55 2012
New Revision: 1236966

URL: http://svn.apache.org/viewvc?rev=1236966&view=rev
Log:
Merged r1236963 from branch-1 for HADOOP-7988.

Modified:
    hadoop/common/branches/branch-1.0/CHANGES.txt
    hadoop/common/branches/branch-1.0/src/core/org/apache/hadoop/security/SecurityUtil.java
    hadoop/common/branches/branch-1.0/src/test/org/apache/hadoop/security/TestSecurityUtil.java

Modified: hadoop/common/branches/branch-1.0/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.0/CHANGES.txt?rev=1236966&r1=1236965&r2=1236966&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.0/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1.0/CHANGES.txt Sat Jan 28 02:51:55 2012
@@ -10,6 +10,9 @@ Release 1.0.1 - unreleased
 
     HADOOP-7987. Support setting the run-as user in unsecure mode. (jitendra)
 
+    HADOOP-7988. Upper case in hostname part of the principals doesn't work with 
+    kerberos. (jitendra)
+
   BUG FIXES
 
     HADOOP-7964. Deadlock in NetUtils and SecurityUtil class initialization.

Modified: hadoop/common/branches/branch-1.0/src/core/org/apache/hadoop/security/SecurityUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.0/src/core/org/apache/hadoop/security/SecurityUtil.java?rev=1236966&r1=1236965&r2=1236966&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.0/src/core/org/apache/hadoop/security/SecurityUtil.java
(original)
+++ hadoop/common/branches/branch-1.0/src/core/org/apache/hadoop/security/SecurityUtil.java
Sat Jan 28 02:51:55 2012
@@ -210,7 +210,7 @@ public class SecurityUtil {
     if (fqdn == null || fqdn.equals("") || fqdn.equals("0.0.0.0")) {
       fqdn = getLocalHostName();
     }
-    return components[0] + "/" + fqdn + "@" + components[2];
+    return components[0] + "/" + fqdn.toLowerCase() + "@" + components[2];
   }
   
   static String getLocalHostName() throws UnknownHostException {

Modified: hadoop/common/branches/branch-1.0/src/test/org/apache/hadoop/security/TestSecurityUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1.0/src/test/org/apache/hadoop/security/TestSecurityUtil.java?rev=1236966&r1=1236965&r2=1236966&view=diff
==============================================================================
--- hadoop/common/branches/branch-1.0/src/test/org/apache/hadoop/security/TestSecurityUtil.java
(original)
+++ hadoop/common/branches/branch-1.0/src/test/org/apache/hadoop/security/TestSecurityUtil.java
Sat Jan 28 02:51:55 2012
@@ -84,6 +84,16 @@ public class TestSecurityUtil {
   }
   
   @Test
+  public void testPrincipalsWithLowerCaseHosts() throws IOException {
+    String service = "xyz/";
+    String realm = "@REALM";
+    String principalInConf = service + SecurityUtil.HOSTNAME_PATTERN + realm;
+    String hostname = "FooHost";
+    String principal = service + hostname.toLowerCase() + realm;
+    verify(principalInConf, hostname, principal);
+  }
+  
+  @Test
   public void testLocalHostNameForNullOrWild() throws Exception {
     String local = SecurityUtil.getLocalHostName();
     assertEquals("hdfs/" + local + "@REALM", SecurityUtil.getServerPrincipal(



Mime
View raw message