charlesconnell opened a new pull request, #6272: URL: https://github.com/apache/hadoop/pull/6272
### Description of PR When `SaslDataTransferServer` or `SaslDataTranferClient` want to get a SASL properties map to do a handshake, they call `SaslPropertiesResolver#getServerProperties()` or `SaslPropertiesResolver#getClientProperties()`, and they get back a `Map<String, String>`. Every call gets the same Map object back, and then the callers sometimes call [put()](https://github.com/apache/hadoop/blob/rel/release-3.3.6/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/datatransfer/sasl/SaslDataTransferServer.java#L385) on it. This means that future users of `SaslPropertiesResolver` get back the wrong information. In this PR, `SaslPropretiesResolver` gives 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](https://github.com/HubSpot/hadoop/commit/6761522efd5f6ac6117ee151c44edb7d97ca0031) 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: - [x] Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')? - [ ] Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation? - [ ] 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)? - [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`, `NOTICE-binary` files? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
