diff options
author | Spencer T Brody <spencer@10gen.com> | 2013-07-29 15:16:32 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@10gen.com> | 2013-07-30 17:50:33 -0400 |
commit | 213f27b7cb23486e62fecbb59659b9ec1a36a8c0 (patch) | |
tree | 0d033d537cd7715f317450241347cc04d3f27ef8 /src/mongo/db/auth/security_key.cpp | |
parent | c0b1115a5be9d554199ce014fe57c479b8ea105b (diff) | |
download | mongo-213f27b7cb23486e62fecbb59659b9ec1a36a8c0.tar.gz |
SERVER-9518 Change internalSecurity to store a User object
Diffstat (limited to 'src/mongo/db/auth/security_key.cpp')
-rw-r--r-- | src/mongo/db/auth/security_key.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/mongo/db/auth/security_key.cpp b/src/mongo/db/auth/security_key.cpp index f66b4d95b48..82fd16c4ad9 100644 --- a/src/mongo/db/auth/security_key.cpp +++ b/src/mongo/db/auth/security_key.cpp @@ -24,6 +24,7 @@ #include "mongo/db/auth/action_type.h" #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/auth/privilege.h" +#include "mongo/db/auth/user.h" #include "mongo/client/sasl_client_authenticate.h" static bool authParamsSet = false; @@ -129,16 +130,19 @@ namespace mongo { LOG(1) << "security key: " << str << endl; - internalSecurity.pwd = DBClientWithCommands::createPasswordDigest( - internalSecurity.user.getUser().toString(), str); + User::CredentialData credentials; + credentials.password = DBClientWithCommands::createPasswordDigest( + internalSecurity.user->getName().getUser().toString(), str); + internalSecurity.user->setCredentials(credentials); if (cmdLine.clusterAuthMode == "keyfile" || cmdLine.clusterAuthMode == "sendKeyfile") { - setInternalUserAuthParams(BSON(saslCommandMechanismFieldName << "MONGODB-CR" << - saslCommandUserSourceFieldName << - internalSecurity.user.getDB() << - saslCommandUserFieldName << internalSecurity.user.getUser() << - saslCommandPasswordFieldName << internalSecurity.pwd << - saslCommandDigestPasswordFieldName << false)); + setInternalUserAuthParams( + BSON(saslCommandMechanismFieldName << "MONGODB-CR" << + saslCommandUserSourceFieldName << + internalSecurity.user->getName().getDB() << + saslCommandUserFieldName << internalSecurity.user->getName().getUser() << + saslCommandPasswordFieldName << credentials.password << + saslCommandDigestPasswordFieldName << false)); } return true; } |