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

Alejandro Abdelnur commented on HADOOP-10224:
---------------------------------------------

In the constructor, the {{throw new IOException("Keystore cannot be loaded 
!!");}} should be more descriptive of the problem, why is the exception is 
being thrown, that CURRENT & _NEW exists, and it should not be the case, only 
one should be there.

In the constructor, when loading the CURRENT and having an error other than bad 
password we should log that CURRENT was corrupted and we loaded OLD. We should 
rename CURRENT to _BAD_$DATE, and report that as well for an admin to delete it.

When loading _NEW and corrupt, we should report that in the exception message 
clearly. Also, shouldn’t we be renaming _NEW to CURRENT here?

"// Check if _NEW exists (incase flush had finished writing but not", typo "in 
case"

"KeyStore intialized anew sucessfully" 2 typos, "KeyStore initialized anew 
successfully"

{{isBadorWrongPassword()}} method, always use {}s for IF blocks.

{{loadFromPath()}}, you don’t want to rename until you know you can load the 
keystore, i would do the rename outside of here.

{{flush()}}, when renaming files verify rename is successful (boolean return 
value) and fail if not.


> JavaKeyStoreProvider has to protect against corrupting underlying store
> -----------------------------------------------------------------------
>
>                 Key: HADOOP-10224
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10224
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: security
>            Reporter: Larry McCay
>            Assignee: Arun Suresh
>         Attachments: HADOOP-10224.1.patch, HADOOP-10224.2.patch, 
> HADOOP-10224.3.patch
>
>
> Java keystores get corrupted at times. A key management operation that writes 
> the store to disk could cause a corruption and all protected data would then 
> be unaccessible.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to