summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/authentication_commands.cpp
diff options
context:
space:
mode:
authorAndreas Nilsson <andreas.nilsson@10gen.com>2013-11-14 18:34:21 +0000
committerAndreas Nilsson <andreas.nilsson@10gen.com>2013-11-14 19:11:40 +0000
commit914602bfd51a6a9e83d24abe6e293c749c09c7e0 (patch)
tree9cf1c38d934ec713520ba69a3a3580fcad68bbfc /src/mongo/db/commands/authentication_commands.cpp
parent9030cdfa8707c06b3f8ad9dfb635c2244abcc84e (diff)
downloadmongo-914602bfd51a6a9e83d24abe6e293c749c09c7e0.tar.gz
SERVER-11431 Change clusterAuthMode with setParameter command
Diffstat (limited to 'src/mongo/db/commands/authentication_commands.cpp')
-rw-r--r--src/mongo/db/commands/authentication_commands.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp
index faa9b9a511f..2803ebbea08 100644
--- a/src/mongo/db/commands/authentication_commands.cpp
+++ b/src/mongo/db/commands/authentication_commands.cpp
@@ -191,7 +191,8 @@ namespace mongo {
Status CmdAuthenticate::_authenticateCR(const UserName& user, const BSONObj& cmdObj) {
if (user == internalSecurity.user->getName() &&
- serverGlobalParams.clusterAuthMode == "x509") {
+ serverGlobalParams.clusterAuthMode.load() ==
+ ServerGlobalParams::ClusterAuthMode_x509) {
return Status(ErrorCodes::AuthenticationFailed,
"Mechanism x509 is required for internal cluster authentication");
}
@@ -297,10 +298,11 @@ namespace mongo {
fassert(17002, !srvClusterId.empty() && srvClusterId != srvSubjectName);
- // Handle internal cluster member auth, only applies to server-server connections
+ // Handle internal cluster member auth, only applies to server-server connections
+ int clusterAuthMode = serverGlobalParams.clusterAuthMode.load();
if (srvClusterId == peerClusterId) {
- if (serverGlobalParams.clusterAuthMode.empty() ||
- serverGlobalParams.clusterAuthMode == "keyFile") {
+ if (clusterAuthMode == ServerGlobalParams::ClusterAuthMode_undefined ||
+ clusterAuthMode == ServerGlobalParams::ClusterAuthMode_keyFile) {
return Status(ErrorCodes::AuthenticationFailed, "The provided certificate "
"can only be used for cluster authentication, not client "
"authentication. The current configuration does not allow "