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

Chris Nauroth commented on HADOOP-9431:
---------------------------------------

For the case covered by this test, the output always will be lower case.  
{{SecurityUtil#getServerPrincipal}} calls {{SecurityUtil#replacePattern}}, and 
that method always calls {{String#toLowerCase}} on the given hostname.

There is another case where the caller passes a {{principalConfig}} that 
doesn't fit the dynamic config syntax.  In this case, it just returns 
{{principalConfig}} as is without conversion.  For example, I could hard-code a 
principal in my config like "cnauroth/MyHost@myrealm".  In this case, the 
method won't perform a conversion on the hostname.  This is different from the 
case covered by this unit test though.

                
> TestSecurityUtil#testLocalHostNameForNullOrWild on systems where hostname 
> contains capital letters
> --------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-9431
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9431
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security, test
>    Affects Versions: 3.0.0
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>            Priority: Trivial
>         Attachments: HADOOP-9431.1.patch
>
>
> {{TestSecurityUtil#testLocalHostNameForNullOrWild}} contains assertions about 
> the principal returned for a null or wildcard hostname.  The logic in 
> {{SecurityUtil#getServerPrincipal}} converts the local hostname to 
> lower-case.  The test method does not perform the same conversion though, so 
> the test passes on systems with a hostname containing no upper-case letters, 
> but it fails if the hostname does contain upper-case letters.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to