diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-09-15 11:15:02 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-09-22 10:51:18 -0400 |
commit | 1f6d501989875dac4bcd7cffbbabf320c3cab289 (patch) | |
tree | 9d029f2d6a03006cb546c5abb8e20f10b0c92ee4 /src/mongo/db/auth/sasl_options.cpp | |
parent | 230005e3ac47b6278e22144af8d9ce417e3e1aa2 (diff) | |
download | mongo-1f6d501989875dac4bcd7cffbbabf320c3cab289.tar.gz |
SERVER-20096: ExportedServerParameter<T> is not thread-safe for parameters changeable at runtime.
Diffstat (limited to 'src/mongo/db/auth/sasl_options.cpp')
-rw-r--r-- | src/mongo/db/auth/sasl_options.cpp | 50 |
1 files changed, 20 insertions, 30 deletions
diff --git a/src/mongo/db/auth/sasl_options.cpp b/src/mongo/db/auth/sasl_options.cpp index 8ca9e38dd63..e0429652d32 100644 --- a/src/mongo/db/auth/sasl_options.cpp +++ b/src/mongo/db/auth/sasl_options.cpp @@ -148,40 +148,29 @@ MONGO_STARTUP_OPTIONS_STORE(SASLOptions)(InitializerContext* context) { // SASL Startup Parameters, making them settable via setParameter on the command line or in the // legacy INI config file. None of these parameters are modifiable at runtime. -ExportedServerParameter<std::vector<std::string>> SASLAuthenticationMechanismsSetting( - ServerParameterSet::getGlobal(), - "authenticationMechanisms", - &saslGlobalParams.authenticationMechanisms, - true, // Change at startup - false); // Change at runtime - -ExportedServerParameter<std::string> SASLHostNameSetting(ServerParameterSet::getGlobal(), - "saslHostName", - &saslGlobalParams.hostName, - true, // Change at startup - false); // Change at runtime - -ExportedServerParameter<std::string> SASLServiceNameSetting(ServerParameterSet::getGlobal(), - "saslServiceName", - &saslGlobalParams.serviceName, - true, // Change at startup - false); // Change at runtime - -ExportedServerParameter<std::string> SASLAuthdPathSetting(ServerParameterSet::getGlobal(), - "saslauthdPath", - &saslGlobalParams.authdPath, - true, // Change at startup - false); // Change at runtime +ExportedServerParameter<std::vector<std::string>, ServerParameterType::kStartupOnly> + SASLAuthenticationMechanismsSetting(ServerParameterSet::getGlobal(), + "authenticationMechanisms", + &saslGlobalParams.authenticationMechanisms); + +ExportedServerParameter<std::string, ServerParameterType::kStartupOnly> SASLHostNameSetting( + ServerParameterSet::getGlobal(), "saslHostName", &saslGlobalParams.hostName); + +ExportedServerParameter<std::string, ServerParameterType::kStartupOnly> SASLServiceNameSetting( + ServerParameterSet::getGlobal(), "saslServiceName", &saslGlobalParams.serviceName); + +ExportedServerParameter<std::string, ServerParameterType::kStartupOnly> SASLAuthdPathSetting( + ServerParameterSet::getGlobal(), "saslauthdPath", &saslGlobalParams.authdPath); const std::string scramIterationCountServerParameter = "scramIterationCount"; -class ExportedScramIterationCountParameter : public ExportedServerParameter<int> { +class ExportedScramIterationCountParameter + : public ExportedServerParameter<int, ServerParameterType::kStartupAndRuntime> { public: ExportedScramIterationCountParameter() - : ExportedServerParameter<int>(ServerParameterSet::getGlobal(), - scramIterationCountServerParameter, - &saslGlobalParams.scramIterationCount, - true, // Change at startup - true) {} // Change at runtime + : ExportedServerParameter<int, ServerParameterType::kStartupAndRuntime>( + ServerParameterSet::getGlobal(), + scramIterationCountServerParameter, + &saslGlobalParams.scramIterationCount) {} virtual Status validate(const int& newValue) { if (newValue < minimumScramIterationCount) { @@ -191,6 +180,7 @@ public: << " is less than the minimum SCRAM iteration count, " << minimumScramIterationCount); } + return Status::OK(); } } scramIterationCountParam; |