summaryrefslogtreecommitdiff
path: root/src/mongo/db/auth/sasl_options_init.cpp
diff options
context:
space:
mode:
authorJason Piao <jason.piao@Jasons-MacBook-Pro.local>2019-06-07 11:40:34 -0400
committerJason Piao <jason.piao@mongodb.com>2019-06-19 16:15:22 -0400
commitc31362708f26397dd20818ab780a5180e257d5a7 (patch)
tree0ed6f50d4f1135ffac585bf6500241bcf9c1c67f /src/mongo/db/auth/sasl_options_init.cpp
parent145f4d0e1e738833f4ea1d0cd8e825088f885995 (diff)
downloadmongo-c31362708f26397dd20818ab780a5180e257d5a7.tar.gz
SERVER-41152 strip white space from auth mechanisms
Diffstat (limited to 'src/mongo/db/auth/sasl_options_init.cpp')
-rw-r--r--src/mongo/db/auth/sasl_options_init.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/auth/sasl_options_init.cpp b/src/mongo/db/auth/sasl_options_init.cpp
index ea8f5f7a65a..b83a94fa1c0 100644
--- a/src/mongo/db/auth/sasl_options_init.cpp
+++ b/src/mongo/db/auth/sasl_options_init.cpp
@@ -32,6 +32,8 @@
#include "mongo/db/auth/sasl_options.h"
#include "mongo/db/auth/sasl_options_gen.h"
+#include <boost/algorithm/string.hpp>
+
#include "mongo/base/status.h"
#include "mongo/util/log.h"
#include "mongo/util/net/socket_utils.h"
@@ -81,6 +83,11 @@ Status storeSASLOptions(const moe::Environment& params) {
if (saslGlobalParams.serviceName.empty())
saslGlobalParams.serviceName = "mongodb";
+ // Strip white space for authentication mechanisms
+ for (auto& mechanism : saslGlobalParams.authenticationMechanisms) {
+ boost::trim(mechanism);
+ }
+
return Status::OK();
}