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/66562417
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/66562417
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/66562417

Branch: refs/heads/HDFS-8707
Commit: 665624179ef06d1ba08f85b4c85d3af546f88282
Parents: ba8ca0b
Author: James Clampffer <[email protected]>
Authored: Mon Jul 10 12:09:30 2017 -0400
Committer: James Clampffer <[email protected]>
Committed: Thu Mar 22 16:20:45 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/66562417/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]

Reply via email to