diff options
author | Ben Caimano <ben.caimano@10gen.com> | 2018-07-31 18:26:07 -0400 |
---|---|---|
committer | Ben Caimano <ben.caimano@10gen.com> | 2018-07-31 18:32:19 -0400 |
commit | 6711ab3bbc02ca98da1af2fe115f07e37bb076e4 (patch) | |
tree | f1859ba3692a982b0afbd06fcb523c830136c25c /src/mongo/db/auth/sasl_scram_server_conversation.cpp | |
parent | 35757e8ef3134fad1a09cb09a69882929d9ebb76 (diff) | |
download | mongo-6711ab3bbc02ca98da1af2fe115f07e37bb076e4.tar.gz |
Revert "SERVER-35890 refactor User cache into InvalidatingLRUCache and UserHandle"
This reverts commit 78dec3622268ad27bb855eda4c6a4ed345412fd9.
Diffstat (limited to 'src/mongo/db/auth/sasl_scram_server_conversation.cpp')
-rw-r--r-- | src/mongo/db/auth/sasl_scram_server_conversation.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/auth/sasl_scram_server_conversation.cpp b/src/mongo/db/auth/sasl_scram_server_conversation.cpp index cab83885352..d3ded3c88f8 100644 --- a/src/mongo/db/auth/sasl_scram_server_conversation.cpp +++ b/src/mongo/db/auth/sasl_scram_server_conversation.cpp @@ -191,17 +191,19 @@ StatusWith<std::tuple<bool, std::string>> SaslSCRAMServerMechanism<Policy>::_fir } // The authentication database is also the source database for the user. + User* userObj; auto authManager = AuthorizationManager::get(opCtx->getServiceContext()); - auto swUser = authManager->acquireUser(opCtx, user); - if (!swUser.isOK()) { - return swUser.getStatus(); + Status status = authManager->acquireUser(opCtx, user, &userObj); + if (!status.isOK()) { + return status; } - auto userObj = std::move(swUser.getValue()); User::CredentialData credentials = userObj->getCredentials(); UserName userName = userObj->getName(); + authManager->releaseUser(userObj); + _scramCredentials = credentials.scram<HashBlock>(); if (!_scramCredentials.isValid()) { |