HDFS-12104: libhdfs++: Make sure all steps in SaslProtocol end up calling AuthComplete. Contributed by James Clampffer.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e64ba874 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e64ba874 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e64ba874 Branch: refs/heads/HDFS-8707 Commit: e64ba87486b9cb40474dfe27cf735cf179cb174c Parents: 3c743b4 Author: James Clampffer <[email protected]> Authored: Mon Jul 10 12:09:30 2017 -0400 Committer: James Clampffer <[email protected]> Committed: Thu Mar 22 17:19:47 2018 -0400 ---------------------------------------------------------------------- .../src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc | 2 ++ 1 file changed, 2 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/e64ba874/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc index 49abe58..3d40c0f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc +++ b/hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/libhdfspp/lib/rpc/sasl_protocol.cc @@ -87,6 +87,7 @@ void SaslProtocol::Authenticate(std::function<void(const Status & status, const // We cheat here since this is always called while holding the RpcConnection's lock std::shared_ptr<RpcConnection> connection = connection_.lock(); if (!connection) { + AuthComplete(Status::AuthenticationFailed("Lost RPC Connection"), AuthInfo()); return; } @@ -335,6 +336,7 @@ bool SaslProtocol::SendSaslMessage(RpcSaslProto & message) std::shared_ptr<RpcConnection> connection = connection_.lock(); if (!connection) { LOG_DEBUG(kRPC, << "Tried sending a SASL Message but the RPC connection was gone"); + AuthComplete(Status::AuthenticationFailed("Lost RPC Connection"), AuthInfo()); return false; } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
