-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-18972: Copy SASL properties map when returning from SaslPropertiesResolver #6272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HADOOP-18972: Copy SASL properties map when returning from SaslPropertiesResolver #6272
Conversation
|
💔 -1 overall
This message was automatically generated. |
steveloughran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code looks straightforward, some minor tuning on production and tests, and you need those yetus checks to be happy too
...n-project/hadoop-common/src/main/java/org/apache/hadoop/security/SaslPropertiesResolver.java
Outdated
Show resolved
Hide resolved
...oject/hadoop-common/src/test/java/org/apache/hadoop/security/TestSaslPropertiesResolver.java
Outdated
Show resolved
Hide resolved
...oject/hadoop-common/src/test/java/org/apache/hadoop/security/TestSaslPropertiesResolver.java
Outdated
Show resolved
Hide resolved
|
🎊 +1 overall
This message was automatically generated. |
|
We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
steveloughran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed this. sorry. patch looks fine.
@charlesconnell can you re-open this, move to junit5/assertJ and we can merge in.
| import java.util.Map; | ||
| import javax.security.sasl.Sasl; | ||
|
|
||
| import org.junit.Before; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are now junit5 tests on trunk now. Either move or just pull all of setup() into testResolverDoesNotMutate()
| } | ||
|
|
||
| private static void assertPrivacyQop(Map<String, String> saslProperties) { | ||
| assertEquals(SaslRpcServer.QualityOfProtection.PRIVACY.getSaslQop(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use AssertJ assertequals
8a432bd to
59c3641
Compare
|
🎊 +1 overall
This message was automatically generated. |
|
@steveloughran Updated! |
Description of PR
When
SaslDataTransferServerorSaslDataTranferClientwant to get a SASL properties map to do a handshake, they callSaslPropertiesResolver#getServerProperties()orSaslPropertiesResolver#getClientProperties(), and they get back aMap<String, String>. Every call gets the same Map object back, and then the callers sometimes call put() on it. This means that future users ofSaslPropertiesResolverget back the wrong information.In this PR,
SaslPropretiesResolvergives out copies of its internal map, so that users can safety modify them.How was this patch tested?
My employer has effectively the same patch already committed to our fork of Hadoop 3.3.1. We are running this in production, and have found that this patch fixes the problem we were experiencing, described in the JIRA ticket.
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?