summaryrefslogtreecommitdiff
path: root/src/mongo/client/sasl_client_authenticate_impl.cpp
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2018-01-16 13:00:48 -0500
committerMathias Stearn <mathias@10gen.com>2018-01-17 17:10:47 -0500
commitdaf6c4714b45aeb8ba1a09380135b3267c4cc280 (patch)
treec436a157d25ccb13f91746ba4e099a6396462115 /src/mongo/client/sasl_client_authenticate_impl.cpp
parent4dc36c7ccb6b5b8f7d865993b5d648fe6dc4b7c7 (diff)
downloadmongo-daf6c4714b45aeb8ba1a09380135b3267c4cc280.tar.gz
SERVER-32617 Fix code that reconstructs status with just code and string
Diffstat (limited to 'src/mongo/client/sasl_client_authenticate_impl.cpp')
-rw-r--r--src/mongo/client/sasl_client_authenticate_impl.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/mongo/client/sasl_client_authenticate_impl.cpp b/src/mongo/client/sasl_client_authenticate_impl.cpp
index d4755a22775..8ea87b55794 100644
--- a/src/mongo/client/sasl_client_authenticate_impl.cpp
+++ b/src/mongo/client/sasl_client_authenticate_impl.cpp
@@ -212,15 +212,9 @@ void asyncSaslConversation(auth::RunCommandHook runCommand,
}
auto serverResponse = response.data.getOwned();
- auto code = getStatusFromCommandResult(serverResponse).code();
-
- // Server versions 2.3.2 and earlier may return "ok: 1" with a non-zero
- // "code" field, indicating a failure. Subsequent versions should
- // return "ok: 0" on failure with a non-zero "code" field to indicate specific
- // failure. In all versions, either (ok: 1, code: > 0) or (ok: 0, code optional)
- // indicate failure.
- if (code != ErrorCodes::OK) {
- return handler({code, serverResponse[saslCommandErrmsgFieldName].str()});
+ auto status = getStatusFromCommandResult(serverResponse);
+ if (!status.isOK()) {
+ return handler(status);
}
// Exit if we have finished