[ 
https://issues.apache.org/jira/browse/HADOOP-11699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14355868#comment-14355868
 ] 

Chris Nauroth commented on HADOOP-11699:
----------------------------------------

The difference is likely that any Linux deployment would have been using 
lower-case host names.  A Windows deployment might use upper-case host names.  
(This is something I've seen Windows admins use as a standard practice.)  Since 
Kerberos is case-sensitive, I think the case used in any principals must match 
the case used in the host name.  Therefore, I'd expect the 2 code paths in 
{{KerberosUtil}} and {{SecurityUtil}} need to be symmetric with regards to case 
conversion.

> _HOST not consistently resolving to lowercase fully qualified hostname on 
> Windows
> ---------------------------------------------------------------------------------
>
>                 Key: HADOOP-11699
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11699
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>    Affects Versions: 2.6.0
>            Reporter: Kevin Minder
>            Assignee: Brahma Reddy Battula
>
> The _HOST marker used for Kerberos principals in various configuration files 
> does not always return lowercase fully qualified hostnames.  For example this 
> setting in hdfs-site.xml
> {code}
> <property>
>   <name>dfs.namenode.kerberos.principal</name>
>   <value>hdfs/[email protected]</value>
> </property>
> {code}
> In particular, this is impeding our work to have Hadoop work with equivalent 
> security on Windows as on Linux.
> In the windows env in which I'm having the issue, I was able to get a fully 
> qualified host name using this version of method getLocalHostName() in .  
> hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java
> {code:java}
>   public static String getLocalHostName() throws UnknownHostException {
>     String hostname = InetAddress.getLocalHost().getCanonicalHostName();
>     if ( !hostname.contains( "." ) ) {
>       final String os = System.getProperties().getProperty( "os.name", "?" 
> ).toLowerCase();
>       if ( os.startsWith( "windows" ) ) {
>         String domain = System.getenv( "USERDNSDOMAIN" );
>         if ( domain != null ) {
>           hostname += "." + domain.trim();
>         }
>       }
>     }
>     return hostname == null ? "localhost" : hostname.toLowerCase();
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to