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

ASF GitHub Bot commented on HADOOP-19010:
-----------------------------------------

anikakelhanka opened a new pull request, #6351:
URL: https://github.com/apache/hadoop/pull/6351

   …Command
   
   ### Description of PR
   The JavaKeyStoreProvider#getCredentialEntry function call returns NULL when 
credential alias not found in jceks file which is an expected behavior. But, 
the CredentialShell#check has no null check in place for the function call 
result which results into NullPointerException at 
[line#368](https://github.com/apache/hadoop/blob/19b9e6a97b8faa0eb48e7b1855ab37e6d4b6c2a9/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/alias/CredentialShell.java#L368).
   
   Proposed Fix: The check command should display 'password match failed' 
message when credential alias not found. This is same message that is thrown 
for incorrect alias value:
   
   Password match failed for javax.jdo.option.ConnectionPassword.
   
   ### How was this patch tested?
   All hadoop unit tests are passing. For integration testing, This patch is 
tested locally deploying on hadoop 3.3.5 and 3.3.6 clusters. 
   
   ### For code changes:
   
   - [Yes] Does the title or this PR starts with the corresponding JIRA issue 
id (e.g. 'HADOOP-17799. Your PR title ...')?
   - [NA ] Object storage: have the integration tests been executed and the 
endpoint declared according to the connector-specific documentation?
   - [NA] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [NA] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, 
`NOTICE-binary` files?
   
   




> NullPointerException in Hadoop Credential Check CLI Command
> -----------------------------------------------------------
>
>                 Key: HADOOP-19010
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19010
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 3.3.0
>            Reporter: Anika Kelhanka
>            Priority: Major
>
> *Description*: Hadoop's credential check throws {{NullPointerException}} when 
> alias not found.
> {code:bash}
> hadoop credential check "fs.gs.proxy.username" -provider 
> "jceks://file/usr/lib/hive/conf/hive.jceks" {code}
> Checking aliases for CredentialProvider: 
> jceks://file/usr/lib/hive/conf/hive.jceks
> Enter alias password: 
> java.lang.NullPointerException
> at
> org.apache.hadoop.security.alias.CredentialShell$CheckCommand.execute(CredentialShell.java:369)
> at org.apache.hadoop.tools.CommandShell.run(CommandShell.java:73)
> at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:82)
> at 
> org.apache.hadoop.security.alias.CredentialShell.main(CredentialShell.java:529)}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to